Notebook[{
Cell["\<\
Getting equations of motion and simplifying \[OpenCurlyDoubleQuote]C-tensors\
\[CloseCurlyDoubleQuote] for Einstein-dilaton-Gauss-Bonnet and dynamical \
Chern-Simons theories\
\>", "Section"],

Cell[CellGroupData[{

Cell[TextData[{
 "Author: Leo C. Stein (",
 ButtonBox["leo.stein@gmail.com",
  BaseStyle->"Hyperlink",
  ButtonData->{
    URL["mailto:leo.stein@gmail.com"], None},
  ButtonNote->"mailto:leo.stein@gmail.com"],
 ")\nDate: 2017 Aug. 6. Updated 2017 Dec. 31\nSee also the companion ",
 ButtonBox["web note on my site",
  BaseStyle->"Hyperlink",
  ButtonData->{
    URL["https://duetosymmetry.com/notes/note-on-simple-eoms-for-edgb-dcs/"], 
    None},
  ButtonNote->
   "https://duetosymmetry.com/notes/note-on-simple-eoms-for-edgb-dcs/"],
 "."
}], "Subtitle"],

Cell["\<\
Acknowledgments: Helvi Witek originally showed me one simplified form of the \
\[OpenCurlyDoubleQuote]C-tensor\[CloseCurlyDoubleQuote] in EDGB.\
\>", "Subsubtitle"],

Cell[CellGroupData[{

Cell["0. Load the system, preliminaries", "Subsection"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"Needs", "[", "\"\<xAct`xPert`\>\"", "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"$DefInfoQ", "=", "False"}], ";"}]}], "Input"],

Cell[CellGroupData[{

Cell[BoxData["\<\"------------------------------------------------------------\
\"\>"], "Print"],

Cell[BoxData[
 InterpretationBox[
  RowBox[{"\<\"Package xAct`xPerm`  version \"\>", 
   "\[InvisibleSpace]", "\<\"1.2.3\"\>", "\[InvisibleSpace]", "\<\", \"\>", 
   "\[InvisibleSpace]", 
   RowBox[{"{", 
    RowBox[{"2015", ",", "8", ",", "23"}], "}"}]}],
  SequenceForm["Package xAct`xPerm`  version ", "1.2.3", ", ", {2015, 8, 23}],
  
  Editable->False]], "Print"],

Cell[BoxData["\<\"CopyRight (C) 2003-2015, Jose M. Martin-Garcia, under the \
General Public License.\"\>"], "Print"],

Cell[BoxData["\<\"Connecting to external mac executable...\"\>"], "Print"],

Cell[BoxData["\<\"Connection established.\"\>"], "Print"],

Cell[BoxData["\<\"------------------------------------------------------------\
\"\>"], "Print"],

Cell[BoxData[
 InterpretationBox[
  RowBox[{"\<\"Package xAct`xTensor`  version \"\>", 
   "\[InvisibleSpace]", "\<\"1.1.2\"\>", "\[InvisibleSpace]", "\<\", \"\>", 
   "\[InvisibleSpace]", 
   RowBox[{"{", 
    RowBox[{"2015", ",", "8", ",", "23"}], "}"}]}],
  SequenceForm[
  "Package xAct`xTensor`  version ", "1.1.2", ", ", {2015, 8, 23}],
  Editable->False]], "Print"],

Cell[BoxData["\<\"CopyRight (C) 2002-2015, Jose M. Martin-Garcia, under the \
General Public License.\"\>"], "Print"],

Cell[BoxData["\<\"------------------------------------------------------------\
\"\>"], "Print"],

Cell[BoxData[
 InterpretationBox[
  RowBox[{"\<\"Package xAct`xPert`  version \"\>", 
   "\[InvisibleSpace]", "\<\"1.0.5\"\>", "\[InvisibleSpace]", "\<\", \"\>", 
   "\[InvisibleSpace]", 
   RowBox[{"{", 
    RowBox[{"2014", ",", "9", ",", "28"}], "}"}]}],
  SequenceForm["Package xAct`xPert`  version ", "1.0.5", ", ", {2014, 9, 28}],
  
  Editable->False]], "Print"],

Cell[BoxData["\<\"CopyRight (C) 2005-2015, David Brizuela, Jose M. \
Martin-Garcia and Guillermo A. Mena Marugan, under the General Public \
License.\"\>"], "Print"],

Cell[BoxData["\<\"------------------------------------------------------------\
\"\>"], "Print"],

Cell[BoxData["\<\"These packages come with ABSOLUTELY NO WARRANTY; for \
details type Disclaimer[]. This is free software, and you are welcome to \
redistribute it under certain conditions. See the General Public License for \
details.\"\>"], "Print"],

Cell[BoxData["\<\"------------------------------------------------------------\
\"\>"], "Print"],

Cell[BoxData[
 InterpretationBox[
  RowBox[{"\<\"** Variable \"\>", "\[InvisibleSpace]", "$PrePrint", 
   "\[InvisibleSpace]", "\<\" assigned value \"\>", "\[InvisibleSpace]", 
   "ScreenDollarIndices"}],
  SequenceForm[
  "** Variable ", $PrePrint, " assigned value ", 
   xAct`xTensor`ScreenDollarIndices],
  Editable->False]], "Print"],

Cell[BoxData[
 InterpretationBox[
  RowBox[{"\<\"** Variable \"\>", "\[InvisibleSpace]", "$CovDFormat", 
   "\[InvisibleSpace]", "\<\" changed from \"\>", 
   "\[InvisibleSpace]", "\<\"Prefix\"\>", "\[InvisibleSpace]", "\<\" to \"\>",
    "\[InvisibleSpace]", "\<\"Postfix\"\>"}],
  SequenceForm[
  "** Variable ", xAct`xTensor`$CovDFormat, " changed from ", "Prefix", 
   " to ", "Postfix"],
  Editable->False]], "Print"],

Cell[BoxData[
 InterpretationBox[
  RowBox[{"\<\"** Option \"\>", "\[InvisibleSpace]", "AllowUpperDerivatives", 
   "\[InvisibleSpace]", "\<\" of \"\>", "\[InvisibleSpace]", "ContractMetric",
    "\[InvisibleSpace]", "\<\" changed from \"\>", "\[InvisibleSpace]", 
   "False", "\[InvisibleSpace]", "\<\" to \"\>", "\[InvisibleSpace]", "True"}],
  SequenceForm[
  "** Option ", xAct`xTensor`AllowUpperDerivatives, " of ", 
   xAct`xTensor`ContractMetric, " changed from ", False, " to ", True],
  Editable->False]], "Print"],

Cell[BoxData[
 InterpretationBox[
  RowBox[{"\<\"** Option \"\>", "\[InvisibleSpace]", "MetricOn", 
   "\[InvisibleSpace]", "\<\" of \"\>", "\[InvisibleSpace]", "MakeRule", 
   "\[InvisibleSpace]", "\<\" changed from \"\>", "\[InvisibleSpace]", "None",
    "\[InvisibleSpace]", "\<\" to \"\>", "\[InvisibleSpace]", "All"}],
  SequenceForm[
  "** Option ", xAct`xTensor`MetricOn, " of ", xAct`xTensor`MakeRule, 
   " changed from ", None, " to ", All],
  Editable->False]], "Print"],

Cell[BoxData[
 InterpretationBox[
  RowBox[{"\<\"** Option \"\>", "\[InvisibleSpace]", "ContractMetrics", 
   "\[InvisibleSpace]", "\<\" of \"\>", "\[InvisibleSpace]", "MakeRule", 
   "\[InvisibleSpace]", "\<\" changed from \"\>", "\[InvisibleSpace]", 
   "False", "\[InvisibleSpace]", "\<\" to \"\>", "\[InvisibleSpace]", "True"}],
  SequenceForm[
  "** Option ", xAct`xTensor`ContractMetrics, " of ", xAct`xTensor`MakeRule, 
   " changed from ", False, " to ", True],
  Editable->False]], "Print"]
}, Open  ]]
}, Open  ]],

Cell["The constants we will need:", "Text"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"DefConstantSymbol", "/@", 
   RowBox[{"{", 
    RowBox[{"mpl", ",", "\[CurlyEpsilon]"}], "}"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"PrintAs", "[", "mpl", "]"}], "^=", 
   "\"\<\!\(\*SubscriptBox[\(m\), \(pl\)]\)\>\""}], ";"}]}], "Input"],

Cell["A general coupling function", "Text"],

Cell[BoxData[
 RowBox[{
  RowBox[{"DefScalarFunction", "[", "F", "]"}], ";"}]], "Input"],

Cell["Manifold,", "Text"],

Cell[BoxData[
 RowBox[{"DefManifold", "[", 
  RowBox[{"M", ",", "4", ",", 
   RowBox[{"IndexRange", "[", 
    RowBox[{"a", ",", "q"}], "]"}]}], "]"}]], "Input"],

Cell["Metric,", "Text"],

Cell[BoxData[
 RowBox[{"DefMetric", "[", 
  RowBox[{
   RowBox[{"-", "1"}], ",", 
   RowBox[{"met", "[", 
    RowBox[{
     RowBox[{"-", "a"}], ",", 
     RowBox[{"-", "b"}]}], "]"}], ",", "CD", ",", 
   RowBox[{"PrintAs", "\[Rule]", "\"\<g\>\""}]}], "]"}]], "Input"],

Cell["and scalar (or axion for DCS)", "Text"],

Cell[BoxData[
 RowBox[{"DefTensor", "[", 
  RowBox[{
   RowBox[{"\[CurlyTheta]", "[", "]"}], ",", "M"}], "]"}]], "Input"]
}, Closed]],

Cell[CellGroupData[{

Cell["1. A lot of rules we\[CloseCurlyQuote]ll need", "Subsection"],

Cell["Here we teach xTensor some new tricks!", "Text"],

Cell["\<\
Sometimes you want to form a divergence by commuting derivatives farther in:\
\>", "Text"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"PreferDivOf", "[", "tens_", "]"}], ":=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{
      RowBox[{"bigexpr", ":", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"CD", "[", "b_", "]"}], "@", 
         RowBox[{
          RowBox[{"CD", "[", "a_", "]"}], "[", 
          RowBox[{"expr_", "?", 
           RowBox[{"(", 
            RowBox[{
             RowBox[{"!", 
              RowBox[{"FreeQ", "[", 
               RowBox[{"#", ",", 
                RowBox[{"tens", "[", 
                 RowBox[{"___", ",", 
                  RowBox[{"-", "b_"}], ",", "___"}], "]"}]}], "]"}]}], "&"}], 
            ")"}]}], "]"}]}], ")"}]}], "\[RuleDelayed]", 
      RowBox[{"CommuteCovDs", "[", 
       RowBox[{"bigexpr", ",", "CD", ",", 
        RowBox[{"{", 
         RowBox[{"a", ",", "b"}], "}"}]}], "]"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"bigexpr", ":", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"CD", "[", 
          RowBox[{"-", "b_"}], "]"}], "@", 
         RowBox[{
          RowBox[{"CD", "[", "a_", "]"}], "[", 
          RowBox[{"expr_", "?", 
           RowBox[{"(", 
            RowBox[{
             RowBox[{"!", 
              RowBox[{"FreeQ", "[", 
               RowBox[{"#", ",", 
                RowBox[{"tens", "[", 
                 RowBox[{"___", ",", "b_", ",", "___"}], "]"}]}], "]"}]}], 
             "&"}], ")"}]}], "]"}]}], ")"}]}], "\[RuleDelayed]", 
      RowBox[{"CommuteCovDs", "[", 
       RowBox[{"bigexpr", ",", "CD", ",", 
        RowBox[{"{", 
         RowBox[{"a", ",", 
          RowBox[{"-", "b"}]}], "}"}]}], "]"}]}]}], "}"}]}], ";"}]], "Input"],

Cell["\<\
The following code is essentially copied out of the xTensor source so that I \
can implement HiddenCommutator more easily:\
\>", "Text"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"SetAttributes", "[", 
   RowBox[{"myCommutator", ",", "HoldFirst"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"myCommutator", "[", 
    RowBox[{"expr_", ",", "covd_", ",", 
     RowBox[{"{", 
      RowBox[{"b_", ",", "a_"}], "}"}]}], "]"}], ":=", 
   RowBox[{
    RowBox[{"xAct`xTensor`Private`addCurvature", "[", 
     RowBox[{"expr", ",", "covd", ",", 
      RowBox[{"{", 
       RowBox[{"a", ",", "b"}], "}"}], ",", 
      RowBox[{"Select", "[", 
       RowBox[{
        RowBox[{"FindFreeIndices", "[", "expr", "]"}], ",", "AIndexQ"}], 
       "]"}], ",", 
      RowBox[{"VBundlesOfCovD", "[", "covd", "]"}]}], "]"}], "+", 
    RowBox[{"xAct`xTensor`Private`addTorsion", "[", 
     RowBox[{"expr", ",", "covd", ",", 
      RowBox[{"{", 
       RowBox[{"a", ",", "b"}], "}"}]}], "]"}], "+", 
    RowBox[{"xAct`xTensor`Private`addOther", "[", 
     RowBox[{"expr", ",", "covd", ",", 
      RowBox[{"{", 
       RowBox[{"a", ",", "b"}], "}"}]}], "]"}]}]}], ";"}]}], "Input"],

Cell["Test if the dual of an index is in a list:", "Text"],

Cell[BoxData[
 RowBox[{
  RowBox[{"ContainsDual", "[", 
   RowBox[{"i_", ",", "inds_List"}], "]"}], ":=", 
  RowBox[{"!", 
   RowBox[{"FreeQ", "[", 
    RowBox[{"inds", ",", 
     RowBox[{"ChangeIndex", "[", "i", "]"}]}], "]"}]}]}]], "Input"],

Cell["\<\
If we have \[Epsilon] contracted with two derivatives, then their indices are \
antisymmetric, and we can replace with Riemanns, via myCommutator (above):\
\>", "Text"],

Cell[BoxData[
 RowBox[{
  RowBox[{"HiddenCommutatorRule", "=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"epsilonmet", "[", "inds__", "]"}], 
        RowBox[{
         RowBox[{
          RowBox[{"covd_", "?", "CovDQ"}], "[", "a_", "]"}], "@", 
         RowBox[{
          RowBox[{"covd_", "[", "b_", "]"}], "@", "inner_"}]}]}], " ", "/;", 
       RowBox[{
        RowBox[{"ContainsDual", "[", 
         RowBox[{"a", ",", 
          RowBox[{"{", "inds", "}"}]}], "]"}], "&&", 
        RowBox[{"ContainsDual", "[", 
         RowBox[{"b", ",", 
          RowBox[{"{", "inds", "}"}]}], "]"}]}]}], "\[RuleDelayed]", 
      RowBox[{
       RowBox[{"epsilonmet", "[", "inds", "]"}], 
       FractionBox["1", "2"], 
       RowBox[{"myCommutator", "[", 
        RowBox[{"inner", ",", "covd", ",", 
         RowBox[{"{", 
          RowBox[{"a", ",", "b"}], "}"}]}], "]"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"epsilonmet", "[", "inds__", "]"}], 
        RowBox[{
         RowBox[{
          RowBox[{"covd1_", "?", "CovDQ"}], "[", "c_", "]"}], "@", 
         RowBox[{
          RowBox[{
           RowBox[{"covd2_", "?", "CovDQ"}], "[", "a_", "]"}], "@", 
          RowBox[{
           RowBox[{"covd2_", "[", "b_", "]"}], "@", "inner_"}]}]}]}], " ", "/;", 
       RowBox[{
        RowBox[{"ContainsDual", "[", 
         RowBox[{"a", ",", 
          RowBox[{"{", "inds", "}"}]}], "]"}], "&&", 
        RowBox[{"ContainsDual", "[", 
         RowBox[{"b", ",", 
          RowBox[{"{", "inds", "}"}]}], "]"}]}]}], "\[RuleDelayed]", 
      RowBox[{
       RowBox[{"epsilonmet", "[", "inds", "]"}], 
       FractionBox["1", "2"], 
       RowBox[{
        RowBox[{"covd1", "[", "c", "]"}], "@", 
        RowBox[{"myCommutator", "[", 
         RowBox[{"inner", ",", "covd2", ",", 
          RowBox[{"{", 
           RowBox[{"a", ",", "b"}], "}"}]}], "]"}]}]}]}]}], "}"}]}], 
  ";"}]], "Input"],

Cell["How many indices are paired between the two lists:", "Text"],

Cell[BoxData[
 RowBox[{
  RowBox[{"NumPairs", "[", 
   RowBox[{"inds1_List", ",", "inds2_List"}], "]"}], ":=", 
  RowBox[{"Length", "@", 
   RowBox[{"Select", "[", 
    RowBox[{"inds1", ",", 
     RowBox[{
      RowBox[{"ContainsDual", "[", 
       RowBox[{"#", ",", "inds2"}], "]"}], "&"}]}], "]"}]}]}]], "Input"],

Cell["\<\
The first and second Bianchi identities (when there are explicit \[Epsilon]\
\[CloseCurlyQuote]s), including when there\[CloseCurlyQuote]s one intervening \
derivative:\
\>", "Text"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"EpsBianchiRules", "=", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"epsilonmet", "[", "inds1__", "]"}], 
       RowBox[{"RiemannCD", "[", "inds2___", "]"}]}], "/;", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"NumPairs", "[", 
         RowBox[{
          RowBox[{"{", "inds1", "}"}], ",", 
          RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "3"}], 
       ")"}]}], "\[Rule]", "0"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"epsilonmet", "[", "inds1__", "]"}], 
       RowBox[{"WeylCD", "[", "inds2___", "]"}]}], "/;", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"NumPairs", "[", 
         RowBox[{
          RowBox[{"{", "inds1", "}"}], ",", 
          RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "3"}], 
       ")"}]}], "\[Rule]", "0"}], ",", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"epsilonmet", "[", "inds1__", "]"}], 
       RowBox[{
        RowBox[{"CD", "[", "_", "]"}], "@", 
        RowBox[{"RiemannCD", "[", "inds2___", "]"}]}]}], "/;", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"NumPairs", "[", 
         RowBox[{
          RowBox[{"{", "inds1", "}"}], ",", 
          RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "3"}], 
       ")"}]}], "\[Rule]", "0"}], ",", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"epsilonmet", "[", "inds1__", "]"}], 
       RowBox[{
        RowBox[{"CD", "[", "_", "]"}], "@", 
        RowBox[{"WeylCD", "[", "inds2___", "]"}]}]}], "/;", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"NumPairs", "[", 
         RowBox[{
          RowBox[{"{", "inds1", "}"}], ",", 
          RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "3"}], 
       ")"}]}], "\[Rule]", "0"}], ",", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"epsilonmet", "[", "inds1__", "]"}], 
       RowBox[{
        RowBox[{"CD", "[", "a_", "]"}], "@", 
        RowBox[{"RiemannCD", "[", "inds2__", "]"}]}]}], "/;", 
      RowBox[{
       RowBox[{"ContainsDual", "[", 
        RowBox[{"a", ",", 
         RowBox[{"{", "inds1", "}"}]}], "]"}], "&&", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"NumPairs", "[", 
          RowBox[{
           RowBox[{"{", "inds1", "}"}], ",", 
           RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "2"}], 
        ")"}]}]}], "\[RuleDelayed]", "0"}], ",", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"epsilonmet", "[", "inds1__", "]"}], 
       RowBox[{
        RowBox[{"CD", "[", "_", "]"}], "@", 
        RowBox[{
         RowBox[{"CD", "[", "a_", "]"}], "@", 
         RowBox[{"RiemannCD", "[", "inds2__", "]"}]}]}]}], "/;", 
      RowBox[{
       RowBox[{"ContainsDual", "[", 
        RowBox[{"a", ",", 
         RowBox[{"{", "inds1", "}"}]}], "]"}], "&&", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{"NumPairs", "[", 
          RowBox[{
           RowBox[{"{", "inds1", "}"}], ",", 
           RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "2"}], 
        ")"}]}]}], "\[RuleDelayed]", "0"}]}], "}"}]}]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds1", "_"]},
              {" "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[
        Pattern[$CellContext`inds1, 
         BlankSequence[]]],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds2", "_"]},
              {" "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RiemannCD[
        Pattern[$CellContext`inds2, 
         BlankNullSequence[]]],
       Editable->False]}], "/;", 
     RowBox[{
      RowBox[{"NumPairs", "[", 
       RowBox[{
        RowBox[{"{", "inds1", "}"}], ",", 
        RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "3"}]}], 
    "\[Rule]", "0"}], ",", 
   RowBox[{
    RowBox[{
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds1", "_"]},
              {" "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[
        Pattern[$CellContext`inds1, 
         BlankSequence[]]],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds2", "_"]},
              {" "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`WeylCD[
        Pattern[$CellContext`inds2, 
         BlankNullSequence[]]],
       Editable->False]}], "/;", 
     RowBox[{
      RowBox[{"NumPairs", "[", 
       RowBox[{
        RowBox[{"{", "inds1", "}"}], ",", 
        RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "3"}]}], 
    "\[Rule]", "0"}], ",", 
   RowBox[{
    RowBox[{
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds1", "_"]},
              {" "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[
        Pattern[$CellContext`inds1, 
         BlankSequence[]]],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds2", "_"], 
               RowBox[{";", "_"}]},
              {" ", "  "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`CD[
        Blank[]][
        $CellContext`RiemannCD[
         Pattern[$CellContext`inds2, 
          BlankNullSequence[]]]],
       Editable->False]}], "/;", 
     RowBox[{
      RowBox[{"NumPairs", "[", 
       RowBox[{
        RowBox[{"{", "inds1", "}"}], ",", 
        RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "3"}]}], 
    "\[Rule]", "0"}], ",", 
   RowBox[{
    RowBox[{
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds1", "_"]},
              {" "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[
        Pattern[$CellContext`inds1, 
         BlankSequence[]]],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds2", "_"], 
               RowBox[{";", "_"}]},
              {" ", "  "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`CD[
        Blank[]][
        $CellContext`WeylCD[
         Pattern[$CellContext`inds2, 
          BlankNullSequence[]]]],
       Editable->False]}], "/;", 
     RowBox[{
      RowBox[{"NumPairs", "[", 
       RowBox[{
        RowBox[{"{", "inds1", "}"}], ",", 
        RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "3"}]}], 
    "\[Rule]", "0"}], ",", 
   RowBox[{
    RowBox[{
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds1", "_"]},
              {" "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[
        Pattern[$CellContext`inds1, 
         BlankSequence[]]],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds2", "_"], 
               RowBox[{";", 
                UnderscriptBox["a", "_"]}]},
              {" ", "  "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`CD[
        Pattern[$CellContext`a, 
         Blank[]]][
        $CellContext`RiemannCD[
         Pattern[$CellContext`inds2, 
          BlankSequence[]]]],
       Editable->False]}], "/;", 
     RowBox[{
      RowBox[{"ContainsDual", "[", 
       RowBox[{"a", ",", 
        RowBox[{"{", "inds1", "}"}]}], "]"}], "&&", 
      RowBox[{
       RowBox[{"NumPairs", "[", 
        RowBox[{
         RowBox[{"{", "inds1", "}"}], ",", 
         RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "2"}]}]}], 
    "\[RuleDelayed]", "0"}], ",", 
   RowBox[{
    RowBox[{
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds1", "_"]},
              {" "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[
        Pattern[$CellContext`inds1, 
         BlankSequence[]]],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {
               UnderscriptBox["inds2", "_"], 
               RowBox[{";", 
                UnderscriptBox["a", "_"]}], 
               RowBox[{";", "_"}]},
              {" ", "  ", "  "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`CD[
        Blank[]][
        $CellContext`CD[
         Pattern[$CellContext`a, 
          Blank[]]][
         $CellContext`RiemannCD[
          Pattern[$CellContext`inds2, 
           BlankSequence[]]]]],
       Editable->False]}], "/;", 
     RowBox[{
      RowBox[{"ContainsDual", "[", 
       RowBox[{"a", ",", 
        RowBox[{"{", "inds1", "}"}]}], "]"}], "&&", 
      RowBox[{
       RowBox[{"NumPairs", "[", 
        RowBox[{
         RowBox[{"{", "inds1", "}"}], ",", 
         RowBox[{"{", "inds2", "}"}]}], "]"}], "\[GreaterEqual]", "2"}]}]}], 
    "\[RuleDelayed]", "0"}]}], "}"}]], "Output"]
}, Open  ]],

Cell["\<\
This comes from Sec. 9.2 of the file `xTensorDoc.nb`, divergence of Riemann:\
\>", "Text"],

Cell[BoxData[
 RowBox[{
  RowBox[{"RuleDivRiemann", "=", 
   RowBox[{"MakeRule", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{
        RowBox[{"CD", "[", "a", "]"}], "@", 
        RowBox[{"RiemannCD", "[", 
         RowBox[{
          RowBox[{"-", "a"}], ",", 
          RowBox[{"-", "b"}], ",", 
          RowBox[{"-", "c"}], ",", 
          RowBox[{"-", "d"}]}], "]"}]}], ",", 
       RowBox[{
        RowBox[{"-", 
         RowBox[{
          RowBox[{"CD", "[", 
           RowBox[{"-", "d"}], "]"}], "@", 
          RowBox[{"RicciCD", "[", 
           RowBox[{
            RowBox[{"-", "b"}], ",", 
            RowBox[{"-", "c"}]}], "]"}]}]}], "+", 
        RowBox[{
         RowBox[{"CD", "[", 
          RowBox[{"-", "c"}], "]"}], "@", 
         RowBox[{"RicciCD", "[", 
          RowBox[{
           RowBox[{"-", "b"}], ",", 
           RowBox[{"-", "d"}]}], "]"}]}]}]}], "}"}], ",", 
     RowBox[{"UseSymmetries", "\[Rule]", "True"}], ",", 
     RowBox[{"MetricOn", "\[Rule]", "All"}]}], "]"}]}], ";"}]], "Input"],

Cell["\<\
Here is just converting from Ricci to Einstein in the case that there is a \
divergence of Ricci:\
\>", "Text"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"RuleDivRicci", "=", 
  RowBox[{"MakeRule", "[", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{
      RowBox[{"CD", "[", "a", "]"}], "@", 
      RowBox[{"RicciCD", "[", 
       RowBox[{
        RowBox[{"-", "a"}], ",", 
        RowBox[{"-", "b"}]}], "]"}]}], ",", 
     RowBox[{"Evaluate", "[", 
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"CD", "[", "a", "]"}], "@", 
         RowBox[{"RicciCD", "[", 
          RowBox[{
           RowBox[{"-", "a"}], ",", 
           RowBox[{"-", "b"}]}], "]"}]}], "//", "RicciToEinstein"}], "//", 
       "ContractMetric"}], "]"}]}], "}"}], "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{
    RowBox[{"HoldPattern", "[", 
     InterpretationBox[
      StyleBox[GridBox[{
         {
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
          StyleBox[GridBox[{
             {" ", 
              UnderscriptBox[
               UnderscriptBox["b", "_"], "_"], 
              RowBox[{";", 
               UnderscriptBox[
                UnderscriptBox["a", "_"], "_"]}]},
             {
              UnderscriptBox[
               UnderscriptBox["a", "_"], "_"], " ", "  "}
            },
            GridBoxSpacings->{"Columns" -> {
                Offset[0.], {
                 Offset[0.034999999999999996`]}, 
                Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                 Offset[0.]}}, "RowsIndexed" -> {}}],
           FontSize->Rational[39, 4]]}
        },
        GridBoxAlignment->{
         "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
          "Rows" -> {{Center}}, "RowsIndexed" -> {}},
        GridBoxSpacings->{"Columns" -> {
            Offset[0.27999999999999997`], {
             Offset[0.034999999999999996`]}, 
            Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
          "Rows" -> {
            Offset[0.2], {
             Offset[0.4]}, 
            Offset[0.2]}, "RowsIndexed" -> {}}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`CD[
       PatternTest[
        Pattern[$CellContext`a, 
         Blank[Symbol]], TangentM`Q]][
       $CellContext`RicciCD[-PatternTest[
          Pattern[$CellContext`a, 
           Blank[Symbol]], TangentM`Q], 
        PatternTest[
         Pattern[$CellContext`b, 
          Blank[]], TangentM`pmQ]]],
      Editable->False], "]"}], "\[RuleDelayed]", 
    RowBox[{"Module", "[", 
     RowBox[{
      RowBox[{"{", "}"}], ",", 
      FractionBox[
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "b"], 
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}]}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`b][
         $CellContext`RicciScalarCD[]],
        Editable->False], "2"]}], "]"}]}], ",", 
   RowBox[{
    RowBox[{"HoldPattern", "[", 
     InterpretationBox[
      StyleBox[GridBox[{
         {
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
          StyleBox[GridBox[{
             {
              UnderscriptBox[
               UnderscriptBox["a", "_"], "_"], 
              UnderscriptBox[
               UnderscriptBox["b", "_"], "_"], "  "},
             {" ", " ", 
              RowBox[{";", 
               UnderscriptBox[
                UnderscriptBox["a", "_"], "_"]}]}
            },
            GridBoxSpacings->{"Columns" -> {
                Offset[0.], {
                 Offset[0.034999999999999996`]}, 
                Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                 Offset[0.]}}, "RowsIndexed" -> {}}],
           FontSize->Rational[39, 4]]}
        },
        GridBoxAlignment->{
         "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
          "Rows" -> {{Center}}, "RowsIndexed" -> {}},
        GridBoxSpacings->{"Columns" -> {
            Offset[0.27999999999999997`], {
             Offset[0.034999999999999996`]}, 
            Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
          "Rows" -> {
            Offset[0.2], {
             Offset[0.4]}, 
            Offset[0.2]}, "RowsIndexed" -> {}}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`CD[-PatternTest[
         Pattern[$CellContext`a, 
          Blank[Symbol]], TangentM`Q]][
       $CellContext`RicciCD[
        PatternTest[
         Pattern[$CellContext`a, 
          Blank[Symbol]], TangentM`Q], 
        PatternTest[
         Pattern[$CellContext`b, 
          Blank[]], TangentM`pmQ]]],
      Editable->False], "]"}], "\[RuleDelayed]", 
    RowBox[{"Module", "[", 
     RowBox[{
      RowBox[{"{", "}"}], ",", 
      FractionBox[
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "b"], 
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}]}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`b][
         $CellContext`RicciScalarCD[]],
        Editable->False], "2"]}], "]"}]}], ",", 
   RowBox[{
    RowBox[{"HoldPattern", "[", 
     InterpretationBox[
      StyleBox[GridBox[{
         {
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
          StyleBox[GridBox[{
             {
              UnderscriptBox[
               UnderscriptBox["b", "_"], "_"], " ", 
              RowBox[{";", 
               UnderscriptBox[
                UnderscriptBox["a", "_"], "_"]}]},
             {" ", 
              UnderscriptBox[
               UnderscriptBox["a", "_"], "_"], "  "}
            },
            GridBoxSpacings->{"Columns" -> {
                Offset[0.], {
                 Offset[0.034999999999999996`]}, 
                Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                 Offset[0.]}}, "RowsIndexed" -> {}}],
           FontSize->Rational[39, 4]]}
        },
        GridBoxAlignment->{
         "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
          "Rows" -> {{Center}}, "RowsIndexed" -> {}},
        GridBoxSpacings->{"Columns" -> {
            Offset[0.27999999999999997`], {
             Offset[0.034999999999999996`]}, 
            Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
          "Rows" -> {
            Offset[0.2], {
             Offset[0.4]}, 
            Offset[0.2]}, "RowsIndexed" -> {}}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`CD[
       PatternTest[
        Pattern[$CellContext`a, 
         Blank[Symbol]], TangentM`Q]][
       $CellContext`RicciCD[
        PatternTest[
         Pattern[$CellContext`b, 
          Blank[]], TangentM`pmQ], -PatternTest[
          Pattern[$CellContext`a, 
           Blank[Symbol]], TangentM`Q]]],
      Editable->False], "]"}], "\[RuleDelayed]", 
    RowBox[{"Module", "[", 
     RowBox[{
      RowBox[{"{", "}"}], ",", 
      FractionBox[
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "b"], 
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}]}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`b][
         $CellContext`RicciScalarCD[]],
        Editable->False], "2"]}], "]"}]}], ",", 
   RowBox[{
    RowBox[{"HoldPattern", "[", 
     InterpretationBox[
      StyleBox[GridBox[{
         {
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
          StyleBox[GridBox[{
             {
              UnderscriptBox[
               UnderscriptBox["b", "_"], "_"], 
              UnderscriptBox[
               UnderscriptBox["a", "_"], "_"], "  "},
             {" ", " ", 
              RowBox[{";", 
               UnderscriptBox[
                UnderscriptBox["a", "_"], "_"]}]}
            },
            GridBoxSpacings->{"Columns" -> {
                Offset[0.], {
                 Offset[0.034999999999999996`]}, 
                Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                 Offset[0.]}}, "RowsIndexed" -> {}}],
           FontSize->Rational[39, 4]]}
        },
        GridBoxAlignment->{
         "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
          "Rows" -> {{Center}}, "RowsIndexed" -> {}},
        GridBoxSpacings->{"Columns" -> {
            Offset[0.27999999999999997`], {
             Offset[0.034999999999999996`]}, 
            Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
          "Rows" -> {
            Offset[0.2], {
             Offset[0.4]}, 
            Offset[0.2]}, "RowsIndexed" -> {}}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`CD[-PatternTest[
         Pattern[$CellContext`a, 
          Blank[Symbol]], TangentM`Q]][
       $CellContext`RicciCD[
        PatternTest[
         Pattern[$CellContext`b, 
          Blank[]], TangentM`pmQ], 
        PatternTest[
         Pattern[$CellContext`a, 
          Blank[Symbol]], TangentM`Q]]],
      Editable->False], "]"}], "\[RuleDelayed]", 
    RowBox[{"Module", "[", 
     RowBox[{
      RowBox[{"{", "}"}], ",", 
      FractionBox[
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "b"], 
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}]}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`b][
         $CellContext`RicciScalarCD[]],
        Editable->False], "2"]}], "]"}]}]}], "}"}]], "Output"]
}, Open  ]],

Cell[TextData[{
 "I discussed some of these dimensionally dependent identities on ",
 ButtonBox["this post on my web page",
  BaseStyle->"Hyperlink",
  ButtonData->{
    URL["https://duetosymmetry.com/notes/note-on-a-dimension-dependent-Weyl-\
identity/"], None},
  ButtonNote->
   "https://duetosymmetry.com/notes/note-on-a-dimension-dependent-Weyl-\
identity/"],
 "."
}], "Text"],

Cell["\<\
Here is a nice dimensional-dependent identity (that we don\[CloseCurlyQuote]t \
actually use):\
\>", "Text"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"0", "==", 
    RowBox[{
     FractionBox[
      RowBox[{"5", "!"}], 
      RowBox[{"4", "*", "4"}]], 
     RowBox[{"Antisymmetrize", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"WeylCD", "[", 
         RowBox[{"g", ",", "h", ",", 
          RowBox[{"-", "a"}], ",", 
          RowBox[{"-", "b"}]}], "]"}], 
        RowBox[{"WeylCD", "[", 
         RowBox[{"i", ",", "j", ",", 
          RowBox[{"-", "c"}], ",", 
          RowBox[{"-", "d"}]}], "]"}], 
        RowBox[{"delta", "[", 
         RowBox[{"e", ",", 
          RowBox[{"-", "f"}]}], "]"}]}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "a"}], ",", 
         RowBox[{"-", "b"}], ",", 
         RowBox[{"-", "c"}], ",", 
         RowBox[{"-", "d"}], ",", 
         RowBox[{"-", "f"}]}], "}"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"a", ",", 
       RowBox[{"-", "g"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"b", ",", 
       RowBox[{"-", "h"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"c", ",", 
       RowBox[{"-", "i"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"d", ",", 
       RowBox[{"-", "j"}]}], "]"}]}]}], "//", "ToCanonical"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"WeylCD", "[", 
    RowBox[{"e", ",", "a", ",", "b", ",", "c"}], "]"}], 
   RowBox[{"WeylCD", "[", 
    RowBox[{
     RowBox[{"-", "f"}], ",", 
     RowBox[{"-", "a"}], ",", 
     RowBox[{"-", "b"}], ",", 
     RowBox[{"-", "c"}]}], "]"}]}], "+", "%"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"WeylSqRule", "=", 
   RowBox[{"ToRule", "[", "%", "]"}]}], ";"}]}], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   InterpretationBox[
    StyleBox[GridBox[{
       {
        RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
        StyleBox[GridBox[{
           {"e", "a", "b", "c"},
           {" ", " ", " ", " "}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`WeylCD[$CellContext`e, $CellContext`a, $CellContext`b, \
$CellContext`c],
    Editable->False], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {
        RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
        StyleBox[GridBox[{
           {" ", " ", " ", " "},
           {"f", "a", "b", "c"}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`WeylCD[-$CellContext`f, -$CellContext`a, -$CellContext`b, \
-$CellContext`c],
    Editable->False]}], "\[Equal]", 
  RowBox[{
   FractionBox["1", "4"], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {"\[Delta]", 
        StyleBox[GridBox[{
           {"e", " "},
           {" ", "f"}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    xAct`xTensor`delta[$CellContext`e, -$CellContext`f],
    Editable->False], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {
        RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
        StyleBox[GridBox[{
           {" ", " ", " ", " "},
           {"a", "b", "c", "d"}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`WeylCD[-$CellContext`a, -$CellContext`b, -$CellContext`c, \
-$CellContext`d],
    Editable->False], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {
        RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
        StyleBox[GridBox[{
           {"a", "b", "c", "d"},
           {" ", " ", " ", " "}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`WeylCD[$CellContext`a, $CellContext`b, $CellContext`c, \
$CellContext`d],
    Editable->False]}]}]], "Output"]
}, Open  ]],

Cell["This same identity, in terms of Riemann instead of Weyl:", "Text"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"0", "==", 
    RowBox[{
     FractionBox[
      RowBox[{"5", "!"}], 
      RowBox[{"4", "*", "4"}]], 
     RowBox[{"Antisymmetrize", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"RiemannCD", "[", 
         RowBox[{"g", ",", "h", ",", 
          RowBox[{"-", "a"}], ",", 
          RowBox[{"-", "b"}]}], "]"}], 
        RowBox[{"RiemannCD", "[", 
         RowBox[{"i", ",", "j", ",", 
          RowBox[{"-", "c"}], ",", 
          RowBox[{"-", "d"}]}], "]"}], 
        RowBox[{"delta", "[", 
         RowBox[{"e", ",", 
          RowBox[{"-", "f"}]}], "]"}]}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "a"}], ",", 
         RowBox[{"-", "b"}], ",", 
         RowBox[{"-", "c"}], ",", 
         RowBox[{"-", "d"}], ",", 
         RowBox[{"-", "f"}]}], "}"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"a", ",", 
       RowBox[{"-", "g"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"b", ",", 
       RowBox[{"-", "h"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"c", ",", 
       RowBox[{"-", "i"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"d", ",", 
       RowBox[{"-", "j"}]}], "]"}]}]}], "//", "ToCanonical"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"RiemannCD", "[", 
    RowBox[{"e", ",", "a", ",", "b", ",", "c"}], "]"}], 
   RowBox[{"RiemannCD", "[", 
    RowBox[{
     RowBox[{"-", "f"}], ",", 
     RowBox[{"-", "a"}], ",", 
     RowBox[{"-", "b"}], ",", 
     RowBox[{"-", "c"}]}], "]"}]}], "+", "%"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"RiemSqRule", "=", 
   RowBox[{"ToRule", "[", "%", "]"}]}], ";"}]}], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   InterpretationBox[
    StyleBox[GridBox[{
       {
        RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
        StyleBox[GridBox[{
           {"e", "a", "b", "c"},
           {" ", " ", " ", " "}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`RiemannCD[$CellContext`e, $CellContext`a, $CellContext`b, \
$CellContext`c],
    Editable->False], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {
        RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
        StyleBox[GridBox[{
           {" ", " ", " ", " "},
           {"f", "a", "b", "c"}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`RiemannCD[-$CellContext`f, -$CellContext`a, -$CellContext`b, \
-$CellContext`c],
    Editable->False]}], "\[Equal]", 
  RowBox[{
   RowBox[{
    RowBox[{"-", 
     InterpretationBox[
      StyleBox[GridBox[{
         {"\[Delta]", 
          StyleBox[GridBox[{
             {"e", " "},
             {" ", "f"}
            },
            GridBoxSpacings->{"Columns" -> {
                Offset[0.], {
                 Offset[0.034999999999999996`]}, 
                Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                 Offset[0.]}}, "RowsIndexed" -> {}}],
           FontSize->Rational[39, 4]]}
        },
        GridBoxAlignment->{
         "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
          "Rows" -> {{Center}}, "RowsIndexed" -> {}},
        GridBoxSpacings->{"Columns" -> {
            Offset[0.27999999999999997`], {
             Offset[0.034999999999999996`]}, 
            Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
          "Rows" -> {
            Offset[0.2], {
             Offset[0.4]}, 
            Offset[0.2]}, "RowsIndexed" -> {}}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      xAct`xTensor`delta[$CellContext`e, -$CellContext`f],
      Editable->False]}], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {" ", " "},
            {"a", "b"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RicciCD[-$CellContext`a, -$CellContext`b],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {"a", "b"},
            {" ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RicciCD[$CellContext`a, $CellContext`b],
     Editable->False]}], "+", 
   RowBox[{"2", " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {"e", "a"},
            {" ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RicciCD[$CellContext`e, $CellContext`a],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {" ", " "},
            {"f", "a"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RicciCD[-$CellContext`f, -$CellContext`a],
     Editable->False]}], "-", 
   RowBox[{
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {"e", " "},
            {" ", "f"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RicciCD[$CellContext`e, -$CellContext`f],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[
      RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RicciScalarCD[],
     Editable->False]}], "+", 
   RowBox[{
    FractionBox["1", "4"], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {"\[Delta]", 
         StyleBox[GridBox[{
            {"e", " "},
            {" ", "f"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     xAct`xTensor`delta[$CellContext`e, -$CellContext`f],
     Editable->False], " ", 
    SuperscriptBox[
     InterpretationBox[
      StyleBox[
       RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`RicciScalarCD[],
      Editable->False], "2"]}], "+", 
   RowBox[{
    FractionBox["1", "4"], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {"\[Delta]", 
         StyleBox[GridBox[{
            {"e", " "},
            {" ", "f"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     xAct`xTensor`delta[$CellContext`e, -$CellContext`f],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {" ", " ", " ", " "},
            {"a", "b", "c", "d"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RiemannCD[-$CellContext`a, -$CellContext`b, \
-$CellContext`c, -$CellContext`d],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {"a", "b", "c", "d"},
            {" ", " ", " ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RiemannCD[$CellContext`a, $CellContext`b, $CellContext`c, \
$CellContext`d],
     Editable->False]}], "+", 
   RowBox[{"2", " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {"a", "b"},
            {" ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RicciCD[$CellContext`a, $CellContext`b],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {"e", " ", " ", " "},
            {" ", "a", "f", "b"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RiemannCD[$CellContext`e, -$CellContext`a, -$CellContext`f, \
-$CellContext`b],
     Editable->False]}]}]}]], "Output"]
}, Open  ]],

Cell["\<\
Here is the version with one of those Weyls dualized (we \
don\[CloseCurlyQuote]t actually need this identity in this notebook, just \
nice to look at):\
\>", "Text"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"0", "==", 
    RowBox[{
     FractionBox[
      RowBox[{"5", "!"}], 
      RowBox[{"4", "*", "4"}]], 
     RowBox[{"Antisymmetrize", "[", 
      RowBox[{
       RowBox[{
        RowBox[{"epsilonmet", "[", 
         RowBox[{"g", ",", "h", ",", 
          RowBox[{"-", "k"}], ",", 
          RowBox[{"-", "l"}]}], "]"}], 
        RowBox[{"WeylCD", "[", 
         RowBox[{"k", ",", "l", ",", 
          RowBox[{"-", "a"}], ",", 
          RowBox[{"-", "b"}]}], "]"}], 
        RowBox[{"WeylCD", "[", 
         RowBox[{"i", ",", "j", ",", 
          RowBox[{"-", "c"}], ",", 
          RowBox[{"-", "d"}]}], "]"}], 
        RowBox[{"delta", "[", 
         RowBox[{"e", ",", 
          RowBox[{"-", "f"}]}], "]"}]}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "a"}], ",", 
         RowBox[{"-", "b"}], ",", 
         RowBox[{"-", "c"}], ",", 
         RowBox[{"-", "d"}], ",", 
         RowBox[{"-", "f"}]}], "}"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"a", ",", 
       RowBox[{"-", "g"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"b", ",", 
       RowBox[{"-", "h"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"c", ",", 
       RowBox[{"-", "i"}]}], "]"}], 
     RowBox[{"delta", "[", 
      RowBox[{"d", ",", 
       RowBox[{"-", "j"}]}], "]"}]}]}], "//", "ToCanonical"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"%", "/.", "EpsBianchiRules"}]}], "Input"],

Cell[BoxData[
 RowBox[{"0", "\[Equal]", 
  RowBox[{
   RowBox[{
    FractionBox["1", "4"], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {"\[Delta]", 
         StyleBox[GridBox[{
            {"e", " "},
            {" ", "f"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     xAct`xTensor`delta[$CellContext`e, -$CellContext`f],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {"\[Epsilon]g", 
         StyleBox[GridBox[{
            {" ", " ", " ", " "},
            {"c", "d", "k", "l"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`epsilonmet[-$CellContext`c, -$CellContext`d, \
-$CellContext`k, -$CellContext`l],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {" ", " ", "k", "l"},
            {"a", "b", " ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`WeylCD[-$CellContext`a, -$CellContext`b, $CellContext`k, \
$CellContext`l],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {"a", "b", "c", "d"},
            {" ", " ", " ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`WeylCD[$CellContext`a, $CellContext`b, $CellContext`c, \
$CellContext`d],
     Editable->False]}], "-", 
   RowBox[{
    FractionBox["1", "2"], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {"\[Epsilon]g", 
         StyleBox[GridBox[{
            {" ", " ", " ", " "},
            {"b", "c", "d", "k"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`epsilonmet[-$CellContext`b, -$CellContext`c, \
-$CellContext`d, -$CellContext`k],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {"e", "a", "b", "c"},
            {" ", " ", " ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`WeylCD[$CellContext`e, $CellContext`a, $CellContext`b, \
$CellContext`c],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {" ", " ", "d", "k"},
            {"f", "a", " ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`WeylCD[-$CellContext`f, -$CellContext`a, $CellContext`d, \
$CellContext`k],
     Editable->False]}], "-", 
   RowBox[{
    FractionBox["1", "2"], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {"\[Epsilon]g", 
         StyleBox[GridBox[{
            {"e", " ", " ", " "},
            {" ", "a", "d", "k"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`epsilonmet[$CellContext`e, -$CellContext`a, \
-$CellContext`d, -$CellContext`k],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {" ", " ", "d", "k"},
            {"b", "c", " ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`WeylCD[-$CellContext`b, -$CellContext`c, $CellContext`d, \
$CellContext`k],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"W", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {" ", "a", "b", "c"},
            {"f", " ", " ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`WeylCD[-$CellContext`f, $CellContext`a, $CellContext`b, \
$CellContext`c],
     Editable->False]}]}]}]], "Output"]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["2. Lagrangians for EDGB and DCS", "Subsection"],

Cell[TextData[{
 "Standard stuff (recall that ",
 Cell[BoxData[
  FormBox[
   RowBox[{
    SuperscriptBox[
     SubscriptBox["m", "pl"], 
     RowBox[{"-", "2"}]], "=", 
    RowBox[{"8", "\[Pi]", " ", "G"}]}], TraditionalForm]]],
 ")"
}], "Text"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"LEH", "=", 
  RowBox[{
   RowBox[{"Sqrt", "[", 
    RowBox[{"-", 
     RowBox[{"Detmet", "[", "]"}]}], "]"}], 
   FractionBox["1", "2"], 
   SuperscriptBox["mpl", "2"], 
   RowBox[{"RicciScalarCD", "[", "]"}]}]}], "\[IndentingNewLine]", 
 RowBox[{"L\[CurlyTheta]", "=", 
  RowBox[{
   RowBox[{"Sqrt", "[", 
    RowBox[{"-", 
     RowBox[{"Detmet", "[", "]"}]}], "]"}], 
   RowBox[{"(", 
    RowBox[{"-", 
     FractionBox["1", "2"]}], ")"}], 
   RowBox[{
    RowBox[{"CD", "[", 
     RowBox[{"-", "a"}], "]"}], "@", 
    RowBox[{"\[CurlyTheta]", "[", "]"}]}], 
   RowBox[{
    RowBox[{"CD", "[", "a", "]"}], "@", 
    RowBox[{"\[CurlyTheta]", "[", "]"}]}]}]}]}], "Input"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "2"], " ", 
  SuperscriptBox[
   InterpretationBox[
    StyleBox[
     SubscriptBox["m", "pl"],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`mpl,
    Editable->False], "2"], " ", 
  SqrtBox[
   RowBox[{"-", 
    InterpretationBox[
     StyleBox[
      OverscriptBox["g", 
       OverscriptBox[
        StyleBox["~",
         FontColor->RGBColor[0, 0, 0]], 
        StyleBox["~",
         FontColor->RGBColor[0, 0, 0]]]],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`Detmet[],
     Editable->False]}]], " ", 
  InterpretationBox[
   StyleBox[
    RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}],
    ShowAutoStyles->False,
    AutoSpacing->False],
   $CellContext`RicciScalarCD[],
   Editable->False]}]], "Output"],

Cell[BoxData[
 RowBox[{
  RowBox[{"-", 
   FractionBox["1", "2"]}], " ", 
  SqrtBox[
   RowBox[{"-", 
    InterpretationBox[
     StyleBox[
      OverscriptBox["g", 
       OverscriptBox[
        StyleBox["~",
         FontColor->RGBColor[0, 0, 0]], 
        StyleBox["~",
         FontColor->RGBColor[0, 0, 0]]]],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`Detmet[],
     Editable->False]}]], " ", 
  RowBox[{"(", 
   InterpretationBox[
    StyleBox[
     RowBox[{
      SubscriptBox["\[EmptyDownTriangle]", "a"], "\[CurlyTheta]"}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`CD[-$CellContext`a][
     $CellContext`\[CurlyTheta][]],
    Editable->False], ")"}], " ", 
  RowBox[{"(", 
   InterpretationBox[
    StyleBox[
     RowBox[{
      SuperscriptBox["\[EmptyDownTriangle]", "a"], "\[CurlyTheta]"}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`CD[$CellContext`a][
     $CellContext`\[CurlyTheta][]],
    Editable->False], ")"}]}]], "Output"]
}, Open  ]],

Cell[TextData[{
 "Here is a nicer way to write the 4-d Euler-Gauss-Bonnet density. See e.g. \
",
 ButtonBox["Bob McNees\[CloseCurlyQuote]s notes on the Euler density",
  BaseStyle->"Hyperlink",
  ButtonData->{
    URL["http://jacobi.luc.edu/Useful.html#EulerDensities"], None},
  ButtonNote->"http://jacobi.luc.edu/Useful.html#EulerDensities"],
 "."
}], "Text"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"Hold", "[", 
  RowBox[{
   FractionBox["1", "2"], 
   RowBox[{"epsilonmet", "[", 
    RowBox[{"a", ",", "b", ",", "e", ",", "f"}], "]"}], 
   RowBox[{"RiemannCD", "[", 
    RowBox[{
     RowBox[{"-", "e"}], ",", 
     RowBox[{"-", "f"}], ",", 
     RowBox[{"-", "g"}], ",", 
     RowBox[{"-", "h"}]}], "]"}], 
   FractionBox["1", "2"], 
   RowBox[{"epsilonmet", "[", 
    RowBox[{"g", ",", "h", ",", "c", ",", "d"}], "]"}], 
   RowBox[{"RiemannCD", "[", 
    RowBox[{
     RowBox[{"-", "a"}], ",", 
     RowBox[{"-", "b"}], ",", 
     RowBox[{"-", "d"}], ",", 
     RowBox[{"-", "c"}]}], "]"}]}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"%", "//", "ReleaseHold"}], "//", "ContractMetric"}], "//", 
  "ToCanonical"}]}], "Input"],

Cell[BoxData[
 RowBox[{"Hold", "[", 
  FractionBox[
   RowBox[{
    InterpretationBox[
     StyleBox[GridBox[{
        {"\[Epsilon]g", 
         StyleBox[GridBox[{
            {"a", "b", "e", "f"},
            {" ", " ", " ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`epsilonmet[$CellContext`a, $CellContext`b, $CellContext`e, \
$CellContext`f],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {" ", " ", " ", " "},
            {"e", "f", "g", "h"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RiemannCD[-$CellContext`e, -$CellContext`f, \
-$CellContext`g, -$CellContext`h],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {"\[Epsilon]g", 
         StyleBox[GridBox[{
            {"g", "h", "c", "d"},
            {" ", " ", " ", " "}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`epsilonmet[$CellContext`g, $CellContext`h, $CellContext`c, \
$CellContext`d],
     Editable->False], " ", 
    InterpretationBox[
     StyleBox[GridBox[{
        {
         RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
         StyleBox[GridBox[{
            {" ", " ", " ", " "},
            {"a", "b", "d", "c"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`RiemannCD[-$CellContext`a, -$CellContext`b, \
-$CellContext`d, -$CellContext`c],
     Editable->False]}], 
   RowBox[{"2", " ", "2"}]], "]"}]], "Output"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"-", "4"}], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {
        RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
        StyleBox[GridBox[{
           {" ", " "},
           {"a", "b"}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`RicciCD[-$CellContext`a, -$CellContext`b],
    Editable->False], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {
        RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
        StyleBox[GridBox[{
           {"a", "b"},
           {" ", " "}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`RicciCD[$CellContext`a, $CellContext`b],
    Editable->False]}], "+", 
  SuperscriptBox[
   InterpretationBox[
    StyleBox[
     RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`RicciScalarCD[],
    Editable->False], "2"], "+", 
  RowBox[{
   InterpretationBox[
    StyleBox[GridBox[{
       {
        RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
        StyleBox[GridBox[{
           {" ", " ", " ", " "},
           {"a", "b", "e", "f"}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`RiemannCD[-$CellContext`a, -$CellContext`b, -$CellContext`e, \
-$CellContext`f],
    Editable->False], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {
        RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
        StyleBox[GridBox[{
           {"a", "b", "e", "f"},
           {" ", " ", " ", " "}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`RiemannCD[$CellContext`a, $CellContext`b, $CellContext`e, \
$CellContext`f],
    Editable->False]}]}]], "Output"]
}, Open  ]],

Cell["\<\
First, the interaction term for Einstein-dilaton-Gauss-Bonnet:\
\>", "Text"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"LGBint", "=", 
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"Sqrt", "[", 
       RowBox[{"-", 
        RowBox[{"Detmet", "[", "]"}]}], "]"}], 
      FractionBox["\[CurlyEpsilon]", "8"], 
      RowBox[{"F", "[", 
       RowBox[{"\[CurlyTheta]", "[", "]"}], "]"}], 
      RowBox[{"(", 
       RowBox[{
        FractionBox["1", "2"], 
        RowBox[{"epsilonmet", "[", 
         RowBox[{"a", ",", "b", ",", "e", ",", "f"}], "]"}], 
        RowBox[{"RiemannCD", "[", 
         RowBox[{
          RowBox[{"-", "e"}], ",", 
          RowBox[{"-", "f"}], ",", 
          RowBox[{"-", "g"}], ",", 
          RowBox[{"-", "h"}]}], "]"}], 
        FractionBox["1", "2"], 
        RowBox[{"epsilonmet", "[", 
         RowBox[{"g", ",", "h", ",", "c", ",", "d"}], "]"}], 
        RowBox[{"RiemannCD", "[", 
         RowBox[{
          RowBox[{"-", "a"}], ",", 
          RowBox[{"-", "b"}], ",", 
          RowBox[{"-", "d"}], ",", 
          RowBox[{"-", "c"}]}], "]"}]}], ")"}]}], "//", "ContractMetric"}], "//",
     "ToCanonical"}], "//", "Factor"}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"-", 
   FractionBox["1", "8"]}], " ", 
  InterpretationBox[
   StyleBox["\[CurlyEpsilon]",
    ShowAutoStyles->False,
    AutoSpacing->False],
   $CellContext`\[CurlyEpsilon],
   Editable->False], " ", 
  SqrtBox[
   RowBox[{"-", 
    InterpretationBox[
     StyleBox[
      OverscriptBox["g", 
       OverscriptBox[
        StyleBox["~",
         FontColor->RGBColor[0, 0, 0]], 
        StyleBox["~",
         FontColor->RGBColor[0, 0, 0]]]],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`Detmet[],
     Editable->False]}]], " ", 
  RowBox[{
   InterpretationBox[
    StyleBox["F",
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`F,
    Editable->False], "[", 
   InterpretationBox[
    StyleBox["\[CurlyTheta]",
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`\[CurlyTheta][],
    Editable->False], "]"}], " ", 
  RowBox[{"(", 
   RowBox[{
    RowBox[{"4", " ", 
     InterpretationBox[
      StyleBox[GridBox[{
         {
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
          StyleBox[GridBox[{
             {" ", " "},
             {"a", "b"}
            },
            GridBoxSpacings->{"Columns" -> {
                Offset[0.], {
                 Offset[0.034999999999999996`]}, 
                Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                 Offset[0.]}}, "RowsIndexed" -> {}}],
           FontSize->Rational[39, 4]]}
        },
        GridBoxAlignment->{
         "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
          "Rows" -> {{Center}}, "RowsIndexed" -> {}},
        GridBoxSpacings->{"Columns" -> {
            Offset[0.27999999999999997`], {
             Offset[0.034999999999999996`]}, 
            Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
          "Rows" -> {
            Offset[0.2], {
             Offset[0.4]}, 
            Offset[0.2]}, "RowsIndexed" -> {}}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`RicciCD[-$CellContext`a, -$CellContext`b],
      Editable->False], " ", 
     InterpretationBox[
      StyleBox[GridBox[{
         {
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
          StyleBox[GridBox[{
             {"a", "b"},
             {" ", " "}
            },
            GridBoxSpacings->{"Columns" -> {
                Offset[0.], {
                 Offset[0.034999999999999996`]}, 
                Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                 Offset[0.]}}, "RowsIndexed" -> {}}],
           FontSize->Rational[39, 4]]}
        },
        GridBoxAlignment->{
         "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
          "Rows" -> {{Center}}, "RowsIndexed" -> {}},
        GridBoxSpacings->{"Columns" -> {
            Offset[0.27999999999999997`], {
             Offset[0.034999999999999996`]}, 
            Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
          "Rows" -> {
            Offset[0.2], {
             Offset[0.4]}, 
            Offset[0.2]}, "RowsIndexed" -> {}}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`RicciCD[$CellContext`a, $CellContext`b],
      Editable->False]}], "-", 
    SuperscriptBox[
     InterpretationBox[
      StyleBox[
       RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`RicciScalarCD[],
      Editable->False], "2"], "-", 
    RowBox[{
     InterpretationBox[
      StyleBox[GridBox[{
         {
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
          StyleBox[GridBox[{
             {" ", " ", " ", " "},
             {"a", "b", "e", "f"}
            },
            GridBoxSpacings->{"Columns" -> {
                Offset[0.], {
                 Offset[0.034999999999999996`]}, 
                Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                 Offset[0.]}}, "RowsIndexed" -> {}}],
           FontSize->Rational[39, 4]]}
        },
        GridBoxAlignment->{
         "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
          "Rows" -> {{Center}}, "RowsIndexed" -> {}},
        GridBoxSpacings->{"Columns" -> {
            Offset[0.27999999999999997`], {
             Offset[0.034999999999999996`]}, 
            Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
          "Rows" -> {
            Offset[0.2], {
             Offset[0.4]}, 
            Offset[0.2]}, "RowsIndexed" -> {}}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`RiemannCD[-$CellContext`a, -$CellContext`b, \
-$CellContext`e, -$CellContext`f],
      Editable->False], " ", 
     InterpretationBox[
      StyleBox[GridBox[{
         {
          RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
          StyleBox[GridBox[{
             {"a", "b", "e", "f"},
             {" ", " ", " ", " "}
            },
            GridBoxSpacings->{"Columns" -> {
                Offset[0.], {
                 Offset[0.034999999999999996`]}, 
                Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                 Offset[0.]}}, "RowsIndexed" -> {}}],
           FontSize->Rational[39, 4]]}
        },
        GridBoxAlignment->{
         "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
          "Rows" -> {{Center}}, "RowsIndexed" -> {}},
        GridBoxSpacings->{"Columns" -> {
            Offset[0.27999999999999997`], {
             Offset[0.034999999999999996`]}, 
            Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
          "Rows" -> {
            Offset[0.2], {
             Offset[0.4]}, 
            Offset[0.2]}, "RowsIndexed" -> {}}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`RiemannCD[$CellContext`a, $CellContext`b, $CellContext`e, \
$CellContext`f],
      Editable->False]}]}], ")"}]}]], "Output"]
}, Open  ]],

Cell["And now for dynamical Chern-Simons:", "Text"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"LCSint", "=", 
  RowBox[{
   RowBox[{"Sqrt", "[", 
    RowBox[{"-", 
     RowBox[{"Detmet", "[", "]"}]}], "]"}], 
   FractionBox["\[CurlyEpsilon]", "8"], 
   RowBox[{"F", "[", 
    RowBox[{"\[CurlyTheta]", "[", "]"}], "]"}], 
   RowBox[{"(", 
    RowBox[{
     FractionBox["1", "2"], 
     RowBox[{"epsilonmet", "[", 
      RowBox[{"a", ",", "b", ",", "c", ",", "d"}], "]"}], 
     RowBox[{"RiemannCD", "[", 
      RowBox[{
       RowBox[{"-", "a"}], ",", 
       RowBox[{"-", "b"}], ",", 
       RowBox[{"-", "e"}], ",", "f"}], "]"}], 
     RowBox[{"RiemannCD", "[", 
      RowBox[{
       RowBox[{"-", "c"}], ",", 
       RowBox[{"-", "d"}], ",", 
       RowBox[{"-", "f"}], ",", "e"}], "]"}]}], ")"}]}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  FractionBox["1", "16"], " ", 
  InterpretationBox[
   StyleBox["\[CurlyEpsilon]",
    ShowAutoStyles->False,
    AutoSpacing->False],
   $CellContext`\[CurlyEpsilon],
   Editable->False], " ", 
  SqrtBox[
   RowBox[{"-", 
    InterpretationBox[
     StyleBox[
      OverscriptBox["g", 
       OverscriptBox[
        StyleBox["~",
         FontColor->RGBColor[0, 0, 0]], 
        StyleBox["~",
         FontColor->RGBColor[0, 0, 0]]]],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`Detmet[],
     Editable->False]}]], " ", 
  InterpretationBox[
   StyleBox[GridBox[{
      {"\[Epsilon]g", 
       StyleBox[GridBox[{
          {"a", "b", "c", "d"},
          {" ", " ", " ", " "}
         },
         GridBoxSpacings->{"Columns" -> {
             Offset[0.], {
              Offset[0.034999999999999996`]}, 
             Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
              Offset[0.]}}, "RowsIndexed" -> {}}],
        FontSize->Rational[39, 4]]}
     },
     GridBoxAlignment->{
      "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
       "RowsIndexed" -> {}},
     GridBoxSpacings->{"Columns" -> {
         Offset[0.27999999999999997`], {
          Offset[0.034999999999999996`]}, 
         Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
         Offset[0.2], {
          Offset[0.4]}, 
         Offset[0.2]}, "RowsIndexed" -> {}}],
    ShowAutoStyles->False,
    AutoSpacing->False],
   $CellContext`epsilonmet[$CellContext`a, $CellContext`b, $CellContext`c, \
$CellContext`d],
   Editable->False], " ", 
  RowBox[{
   InterpretationBox[
    StyleBox["F",
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`F,
    Editable->False], "[", 
   InterpretationBox[
    StyleBox["\[CurlyTheta]",
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`\[CurlyTheta][],
    Editable->False], "]"}], " ", 
  InterpretationBox[
   StyleBox[GridBox[{
      {
       RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
       StyleBox[GridBox[{
          {" ", " ", " ", "f"},
          {"a", "b", "e", " "}
         },
         GridBoxSpacings->{"Columns" -> {
             Offset[0.], {
              Offset[0.034999999999999996`]}, 
             Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
              Offset[0.]}}, "RowsIndexed" -> {}}],
        FontSize->Rational[39, 4]]}
     },
     GridBoxAlignment->{
      "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
       "RowsIndexed" -> {}},
     GridBoxSpacings->{"Columns" -> {
         Offset[0.27999999999999997`], {
          Offset[0.034999999999999996`]}, 
         Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
         Offset[0.2], {
          Offset[0.4]}, 
         Offset[0.2]}, "RowsIndexed" -> {}}],
    ShowAutoStyles->False,
    AutoSpacing->False],
   $CellContext`RiemannCD[-$CellContext`a, -$CellContext`b, -$CellContext`e, \
$CellContext`f],
   Editable->False], " ", 
  InterpretationBox[
   StyleBox[GridBox[{
      {
       RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
       StyleBox[GridBox[{
          {" ", " ", " ", "e"},
          {"c", "d", "f", " "}
         },
         GridBoxSpacings->{"Columns" -> {
             Offset[0.], {
              Offset[0.034999999999999996`]}, 
             Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
              Offset[0.]}}, "RowsIndexed" -> {}}],
        FontSize->Rational[39, 4]]}
     },
     GridBoxAlignment->{
      "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
       "RowsIndexed" -> {}},
     GridBoxSpacings->{"Columns" -> {
         Offset[0.27999999999999997`], {
          Offset[0.034999999999999996`]}, 
         Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
         Offset[0.2], {
          Offset[0.4]}, 
         Offset[0.2]}, "RowsIndexed" -> {}}],
    ShowAutoStyles->False,
    AutoSpacing->False],
   $CellContext`RiemannCD[-$CellContext`c, -$CellContext`d, -$CellContext`f, \
$CellContext`e],
   Editable->False]}]], "Output"]
}, Open  ]],

Cell["\<\
Note, the up/down positions of indices in LCSint above are important for \
xTensor being able to arrive at the result without tons of hand-holding.\
\>", "Text"],

Cell["Assemble the total Lagrangians for both theories", "Text"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"LGB", "=", 
   RowBox[{"LEH", "+", "L\[CurlyTheta]", "+", "LGBint"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LCS", "=", 
   RowBox[{"LEH", "+", "L\[CurlyTheta]", "+", "LCSint"}]}], ";"}]}], "Input"]
}, Open  ]],

Cell[CellGroupData[{

Cell["3. Perturb actions", "Subsection"],

Cell["\<\
To vary w.r.t. a variation of the metric, we use xPert, and perturb the \
Lagrangian  \
\>", "Text"],

Cell[BoxData[{
 RowBox[{"DefMetricPerturbation", "[", 
  RowBox[{"met", ",", "metpert", ",", "\[Epsilon]"}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"PrintAs", "[", "metpert", "]"}], "^=", "\"\<h\>\""}], 
  ";"}]}], "Input"],

Cell[BoxData[
 RowBox[{"DefTensorPerturbation", "[", 
  RowBox[{
   RowBox[{"\[Delta]\[CurlyTheta]", "[", 
    RowBox[{"LI", "[", "\"\<order\>\"", "]"}], "]"}], ",", 
   RowBox[{"\[CurlyTheta]", "[", "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"M", ",", "\[Epsilon]"}], "}"}]}], "]"}]], "Input"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"LGBpert", "=", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"Perturbation", "[", "LGB", "]"}], "//", "ExpandPerturbation"}],
      "//", "ContractMetric"}], "//", "ToCanonical"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"LCSpert", "=", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"Perturbation", "[", "LCS", "]"}], "//", "ExpandPerturbation"}],
      "//", "ContractMetric"}], "//", "ToCanonical"}]}], ";"}]}], "Input"]
}, Open  ]],

Cell[CellGroupData[{

Cell["4. Einstein-dilaton-Gauss-Bonnet EOM and C-tensor", "Subsection"],

Cell["Get the g equation of motion:", "Text"],

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{
      FractionBox[
       RowBox[{"-", "2"}], 
       SqrtBox[
        RowBox[{"-", 
         RowBox[{"Detmet", "[", "]"}]}]]], 
      RowBox[{
       RowBox[{"VarD", "[", 
        RowBox[{
         RowBox[{"metpert", "[", 
          RowBox[{
           RowBox[{"LI", "[", "1", "]"}], ",", "a", ",", "b"}], "]"}], ",", 
         "CD"}], "]"}], "[", "LGBpert", "]"}]}], "/.", 
     RowBox[{
      RowBox[{"delta", "[", 
       RowBox[{
        RowBox[{"-", 
         RowBox[{"LI", "[", "1", "]"}]}], ",", 
        RowBox[{"LI", "[", "1", "]"}]}], "]"}], "\[Rule]", "1"}]}], "//", 
    "ContractMetric"}], "//", "ToCanonical"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"%", "/.", "RuleDivRiemann"}], "//", "ContractMetric"}], "//", 
   "ToCanonical"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"EOMgGB", "=", 
   RowBox[{
    RowBox[{
     RowBox[{"%", "/.", "RuleDivRicci"}], "//", "ContractMetric"}], "//", 
    "ToCanonical"}]}], ";"}]}], "Input"],

Cell[TextData[{
 "The prefactor in front of ",
 Cell[BoxData[
  FormBox[
   SubscriptBox["G", "ab"], TraditionalForm]]],
 " is ",
 Cell[BoxData[
  FormBox[
   SuperscriptBox[
    SubscriptBox["m", "pl"], 
    RowBox[{"-", "2"}]], TraditionalForm]]],
 ". Here\[CloseCurlyQuote]s the usual Einstein equations, with GB terms \
turned off:"
}], "Text"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{
     FractionBox["1", 
      SuperscriptBox["mpl", "2"]], "EOMgGB"}], "/.", 
    RowBox[{"\[CurlyEpsilon]", "\[Rule]", "0"}]}], "//", "RicciToEinstein"}], 
  "//", "ToCanonical"}]], "Input"],

Cell[BoxData[
 RowBox[{
  InterpretationBox[
   StyleBox[GridBox[{
      {
       RowBox[{"G", "[", "\[EmptyDownTriangle]", "]"}], 
       StyleBox[GridBox[{
          {" ", " "},
          {"a", "b"}
         },
         GridBoxSpacings->{"Columns" -> {
             Offset[0.], {
              Offset[0.034999999999999996`]}, 
             Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
              Offset[0.]}}, "RowsIndexed" -> {}}],
        FontSize->Rational[39, 4]]}
     },
     GridBoxAlignment->{
      "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
       "RowsIndexed" -> {}},
     GridBoxSpacings->{"Columns" -> {
         Offset[0.27999999999999997`], {
          Offset[0.034999999999999996`]}, 
         Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
         Offset[0.2], {
          Offset[0.4]}, 
         Offset[0.2]}, "RowsIndexed" -> {}}],
    ShowAutoStyles->False,
    AutoSpacing->False],
   $CellContext`EinsteinCD[-$CellContext`a, -$CellContext`b],
   Editable->False], "-", 
  FractionBox[
   RowBox[{
    RowBox[{"(", 
     InterpretationBox[
      StyleBox[
       RowBox[{
        SubscriptBox["\[EmptyDownTriangle]", "a"], "\[CurlyTheta]"}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`CD[-$CellContext`a][
       $CellContext`\[CurlyTheta][]],
      Editable->False], ")"}], " ", 
    RowBox[{"(", 
     InterpretationBox[
      StyleBox[
       RowBox[{
        SubscriptBox["\[EmptyDownTriangle]", "b"], "\[CurlyTheta]"}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`CD[-$CellContext`b][
       $CellContext`\[CurlyTheta][]],
      Editable->False], ")"}]}], 
   SuperscriptBox[
    InterpretationBox[
     StyleBox[
      SubscriptBox["m", "pl"],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`mpl,
     Editable->False], "2"]], "+", 
  FractionBox[
   RowBox[{
    InterpretationBox[
     StyleBox[GridBox[{
        {"g", 
         StyleBox[GridBox[{
            {" ", " "},
            {"a", "b"}
           },
           GridBoxSpacings->{"Columns" -> {
               Offset[0.], {
                Offset[0.034999999999999996`]}, 
               Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                Offset[0.]}}, "RowsIndexed" -> {}}],
          FontSize->Rational[39, 4]]}
       },
       GridBoxAlignment->{
        "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}},
          "RowsIndexed" -> {}},
       GridBoxSpacings->{"Columns" -> {
           Offset[0.27999999999999997`], {
            Offset[0.034999999999999996`]}, 
           Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
           Offset[0.2], {
            Offset[0.4]}, 
           Offset[0.2]}, "RowsIndexed" -> {}}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`met[-$CellContext`a, -$CellContext`b],
     Editable->False], " ", 
    RowBox[{"(", 
     InterpretationBox[
      StyleBox[
       RowBox[{
        SubscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`CD[-$CellContext`c][
       $CellContext`\[CurlyTheta][]],
      Editable->False], ")"}], " ", 
    RowBox[{"(", 
     InterpretationBox[
      StyleBox[
       RowBox[{
        SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`CD[$CellContext`c][
       $CellContext`\[CurlyTheta][]],
      Editable->False], ")"}]}], 
   RowBox[{"2", " ", 
    SuperscriptBox[
     InterpretationBox[
      StyleBox[
       SubscriptBox["m", "pl"],
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`mpl,
      Editable->False], "2"]}]]}]], "Output"]
}, Open  ]],

Cell["Save the scalar stress-energy tensor:", "Text"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"T\[CurlyTheta]", "=", 
  RowBox[{
   RowBox[{"-", "EOMgGB"}], "/.", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"mpl", "\[Rule]", "0"}], ",", 
     RowBox[{"\[CurlyEpsilon]", "\[Rule]", "0"}]}], "}"}]}]}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"(", 
    InterpretationBox[
     StyleBox[
      RowBox[{
       SubscriptBox["\[EmptyDownTriangle]", "a"], "\[CurlyTheta]"}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`CD[-$CellContext`a][
      $CellContext`\[CurlyTheta][]],
     Editable->False], ")"}], " ", 
   RowBox[{"(", 
    InterpretationBox[
     StyleBox[
      RowBox[{
       SubscriptBox["\[EmptyDownTriangle]", "b"], "\[CurlyTheta]"}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`CD[-$CellContext`b][
      $CellContext`\[CurlyTheta][]],
     Editable->False], ")"}]}], "-", 
  RowBox[{
   FractionBox["1", "2"], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {"g", 
        StyleBox[GridBox[{
           {" ", " "},
           {"a", "b"}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`met[-$CellContext`a, -$CellContext`b],
    Editable->False], " ", 
   RowBox[{"(", 
    InterpretationBox[
     StyleBox[
      RowBox[{
       SubscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`CD[-$CellContext`c][
      $CellContext`\[CurlyTheta][]],
     Editable->False], ")"}], " ", 
   RowBox[{"(", 
    InterpretationBox[
     StyleBox[
      RowBox[{
       SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`CD[$CellContext`c][
      $CellContext`\[CurlyTheta][]],
     Editable->False], ")"}]}]}]], "Output"]
}, Open  ]],

Cell["\<\
Extract the piece proportional to \[CurlyEpsilon], which is the \
\[OpenCurlyDoubleQuote]C-tensor\[CloseCurlyDoubleQuote] for EDGB, written in \
the usual messy way:\
\>", "Text"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Coefficient", "[", 
   RowBox[{"EOMgGB", ",", "\[CurlyEpsilon]"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"%", "/.", "RiemSqRule"}], "//", "ToCanonical"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"%", "/.", 
     RowBox[{"PreferDivOf", "[", "RicciCD", "]"}]}], "/.", "RuleDivRicci"}], "//",
    "ToCanonical"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"CEDGB", "=", 
  RowBox[{"Collect", "[", 
   RowBox[{"%", ",", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"Derivative", "[", "_", "]"}], "[", "F", "]"}], "[", 
       RowBox[{"\[CurlyTheta]", "[", "]"}], "]"}], ",", 
      RowBox[{"F", "[", 
       RowBox[{"\[CurlyTheta]", "[", "]"}], "]"}]}], "}"}]}], 
   "]"}]}]}], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"(", 
    RowBox[{
     RowBox[{
      RowBox[{"-", 
       FractionBox["1", "2"]}], " ", 
      InterpretationBox[
       StyleBox[
        RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciScalarCD[],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "b"], 
          SubscriptBox["\[EmptyDownTriangle]", "a"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`b][
         $CellContext`CD[-$CellContext`a][
          $CellContext`\[CurlyTheta][]]],
        Editable->False], ")"}]}], "+", 
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", "c"},
              {"b", " "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciCD[-$CellContext`b, $CellContext`c],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "c"], 
          SubscriptBox["\[EmptyDownTriangle]", "a"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`c][
         $CellContext`CD[-$CellContext`a][
          $CellContext`\[CurlyTheta][]]],
        Editable->False], ")"}]}], "+", 
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", "c"},
              {"a", " "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciCD[-$CellContext`a, $CellContext`c],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "c"], 
          SubscriptBox["\[EmptyDownTriangle]", "b"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`c][
         $CellContext`CD[-$CellContext`b][
          $CellContext`\[CurlyTheta][]]],
        Editable->False], ")"}]}], "-", 
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " "},
              {"a", "b"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciCD[-$CellContext`a, -$CellContext`b],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "c"], 
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`c][
         $CellContext`CD[$CellContext`c][
          $CellContext`\[CurlyTheta][]]],
        Editable->False], ")"}]}], "+", 
     RowBox[{
      FractionBox["1", "2"], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"g", 
           StyleBox[GridBox[{
              {" ", " "},
              {"a", "b"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`met[-$CellContext`a, -$CellContext`b],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[
        RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciScalarCD[],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "c"], 
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`c][
         $CellContext`CD[$CellContext`c][
          $CellContext`\[CurlyTheta][]]],
        Editable->False], ")"}]}], "-", 
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {"g", 
           StyleBox[GridBox[{
              {" ", " "},
              {"a", "b"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`met[-$CellContext`a, -$CellContext`b],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {"c", "d"},
              {" ", " "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciCD[$CellContext`c, $CellContext`d],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "d"], 
          SubscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`d][
         $CellContext`CD[-$CellContext`c][
          $CellContext`\[CurlyTheta][]]],
        Editable->False], ")"}]}], "+", 
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " ", " ", " "},
              {"a", "c", "b", "d"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RiemannCD[-$CellContext`a, -$CellContext`c, \
-$CellContext`b, -$CellContext`d],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "d"], 
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`d][
         $CellContext`CD[$CellContext`c][
          $CellContext`\[CurlyTheta][]]],
        Editable->False], ")"}]}]}], ")"}], " ", 
   RowBox[{
    SuperscriptBox[
     InterpretationBox[
      StyleBox["F",
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`F,
      Editable->False], "\[Prime]",
     MultilineFunction->None], "[", 
    InterpretationBox[
     StyleBox["\[CurlyTheta]",
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`\[CurlyTheta][],
     Editable->False], "]"}]}], "+", 
  RowBox[{
   RowBox[{"(", 
    RowBox[{
     RowBox[{
      RowBox[{"-", 
       FractionBox["1", "2"]}], " ", 
      InterpretationBox[
       StyleBox[
        RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciScalarCD[],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "a"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`a][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "b"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`b][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}]}], "+", 
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " "},
              {"b", "c"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciCD[-$CellContext`b, -$CellContext`c],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "a"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`a][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}]}], "+", 
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " "},
              {"a", "c"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciCD[-$CellContext`a, -$CellContext`c],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "b"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`b][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}]}], "-", 
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " "},
              {"a", "b"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciCD[-$CellContext`a, -$CellContext`b],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}]}], "+", 
     RowBox[{
      FractionBox["1", "2"], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"g", 
           StyleBox[GridBox[{
              {" ", " "},
              {"a", "b"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`met[-$CellContext`a, -$CellContext`b],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[
        RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciScalarCD[],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SubscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[-$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}]}], "-", 
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {"g", 
           StyleBox[GridBox[{
              {" ", " "},
              {"a", "b"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`met[-$CellContext`a, -$CellContext`b],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " "},
              {"c", "d"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RicciCD[-$CellContext`c, -$CellContext`d],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "d"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`d][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}]}], "+", 
     RowBox[{
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " ", " ", " "},
              {"a", "c", "b", "d"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RiemannCD[-$CellContext`a, -$CellContext`c, \
-$CellContext`b, -$CellContext`d],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "d"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`d][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}]}]}], ")"}], " ", 
   RowBox[{
    SuperscriptBox[
     InterpretationBox[
      StyleBox["F",
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`F,
      Editable->False], "\[Prime]\[Prime]",
     MultilineFunction->None], "[", 
    InterpretationBox[
     StyleBox["\[CurlyTheta]",
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`\[CurlyTheta][],
     Editable->False], "]"}]}]}]], "Output"]
}, Open  ]],

Cell[TextData[{
 "Show that this can be written more simply as\n  ",
 Cell[BoxData[
  FormBox[
   RowBox[{
    RowBox[{
     SubscriptBox["C", "ab"], "\[DotEqual]", 
     RowBox[{
      RowBox[{
       SuperscriptBox["\[Del]", "c"], 
       RowBox[{
        SuperscriptBox["\[Del]", "d"], 
        SuperscriptBox[
         RowBox[{"[", " "}], "*"]}]}], "\[NegativeThinSpace]", 
      SubscriptBox[
       SuperscriptBox["R", "*"], "dabc"], 
      RowBox[{"F", "[", "\[CurlyTheta]", "]"}]}]}], "]"}], 
   TraditionalForm]]],
 "\nor\n  ",
 Cell[BoxData[
  FormBox[
   RowBox[{
    RowBox[{
     SubscriptBox["C", "ab"], "\[DotEqual]", 
     RowBox[{
      RowBox[{
       SuperscriptBox["\[Del]", "c"], 
       SuperscriptBox[
        RowBox[{"[", " "}], "*"]}], "\[NegativeThinSpace]", 
      SubscriptBox[
       SuperscriptBox["R", "*"], "dabc"], 
      RowBox[{
       SuperscriptBox["\[Del]", "d"], 
       RowBox[{"F", "[", "\[CurlyTheta]", "]"}]}]}]}], "]"}], 
   TraditionalForm]]],
 "\nor even\n  ",
 Cell[BoxData[
  FormBox[
   RowBox[{
    SubscriptBox["C", "ab"], 
    SuperscriptBox["\[DotEqual]", "*"], "\[NegativeThinSpace]", 
    RowBox[{
     SubscriptBox[
      SuperscriptBox["R", "*"], "dabc"], 
     RowBox[{
      SuperscriptBox["\[Del]", "c"], 
      RowBox[{
       SuperscriptBox["\[Del]", "d"], 
       RowBox[{"F", "[", "\[CurlyTheta]", "]"}]}]}]}]}], TraditionalForm]]],
 ",\nbecause the double-dual of Riemann is divergence-free [see e.g. MTW \
(13.51) and exercise 13.11]:"
}], "Text"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"Hold", "[", 
  RowBox[{
   RowBox[{"CD", "[", "c", "]"}], "@", 
   RowBox[{
    RowBox[{"CD", "[", "d", "]"}], "[", 
    RowBox[{
     FractionBox["1", "4"], 
     RowBox[{"epsilonmet", "[", 
      RowBox[{
       RowBox[{"-", "d"}], ",", 
       RowBox[{"-", "a"}], ",", "e", ",", "f"}], "]"}], 
     RowBox[{"RiemannCD", "[", 
      RowBox[{
       RowBox[{"-", "e"}], ",", 
       RowBox[{"-", "f"}], ",", 
       RowBox[{"-", "g"}], ",", 
       RowBox[{"-", "h"}]}], "]"}], 
     RowBox[{"epsilonmet", "[", 
      RowBox[{"g", ",", "h", ",", 
       RowBox[{"-", "b"}], ",", 
       RowBox[{"-", "c"}]}], "]"}], 
     RowBox[{"F", "[", 
      RowBox[{"\[CurlyTheta]", "[", "]"}], "]"}]}], "]"}]}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"%", "//", "ReleaseHold"}], "//", "ContractMetric"}], "//", 
   "ToCanonical"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"%", "/.", "RuleDivRicci"}], "/.", "RuleDivRiemann"}], "//", 
   "ToCanonical"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"%", "==", "CEDGB"}], "//", "ToCanonical"}]}], "Input"],

Cell[BoxData[
 RowBox[{"Hold", "[", 
  InterpretationBox[
   StyleBox[
    RowBox[{
     SuperscriptBox["\[EmptyDownTriangle]", "c"], 
     SuperscriptBox["\[EmptyDownTriangle]", "d"], "[", 
     RowBox[{
      FractionBox["1", "4"], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {" ", " ", "e", "f"},
              {"d", "a", " ", " "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[-$CellContext`d, -$CellContext`a, \
$CellContext`e, $CellContext`f],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " ", " ", " "},
              {"e", "f", "g", "h"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RiemannCD[-$CellContext`e, -$CellContext`f, \
-$CellContext`g, -$CellContext`h],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {"g", "h", " ", " "},
              {" ", " ", "b", "c"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[$CellContext`g, $CellContext`h, \
-$CellContext`b, -$CellContext`c],
       Editable->False], " ", 
      RowBox[{
       InterpretationBox[
        StyleBox["F",
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`F,
        Editable->False], "[", 
       InterpretationBox[
        StyleBox["\[CurlyTheta]",
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`\[CurlyTheta][],
        Editable->False], "]"}]}], "]"}],
    ShowAutoStyles->False,
    AutoSpacing->False],
   $CellContext`CD[$CellContext`c][
    $CellContext`CD[$CellContext`d][((((1/
         4) $CellContext`epsilonmet[-$CellContext`d, -$CellContext`a, \
$CellContext`e, $CellContext`f]) $CellContext`RiemannCD[-$CellContext`e, \
-$CellContext`f, -$CellContext`g, -$CellContext`h]) \
$CellContext`epsilonmet[$CellContext`g, $CellContext`h, -$CellContext`b, \
-$CellContext`c]) $CellContext`F[
       $CellContext`\[CurlyTheta][]]]],
   Editable->False], "]"}]], "Output"],

Cell[BoxData["True"], "Output"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"Hold", "[", 
  RowBox[{
   RowBox[{"CD", "[", "c", "]"}], "[", 
   RowBox[{
    FractionBox["1", "4"], 
    RowBox[{"epsilonmet", "[", 
     RowBox[{
      RowBox[{"-", "d"}], ",", 
      RowBox[{"-", "a"}], ",", "e", ",", "f"}], "]"}], 
    RowBox[{"RiemannCD", "[", 
     RowBox[{
      RowBox[{"-", "e"}], ",", 
      RowBox[{"-", "f"}], ",", 
      RowBox[{"-", "g"}], ",", 
      RowBox[{"-", "h"}]}], "]"}], 
    RowBox[{"epsilonmet", "[", 
     RowBox[{"g", ",", "h", ",", 
      RowBox[{"-", "b"}], ",", 
      RowBox[{"-", "c"}]}], "]"}], " ", 
    RowBox[{
     RowBox[{"CD", "[", "d", "]"}], "@", 
     RowBox[{"F", "[", 
      RowBox[{"\[CurlyTheta]", "[", "]"}], "]"}]}]}], "]"}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"%", "//", "ReleaseHold"}], "//", "ContractMetric"}], "//", 
   "ToCanonical"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"%", "/.", "RuleDivRicci"}], "/.", "RuleDivRiemann"}], "//", 
   "ToCanonical"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"%", "==", "CEDGB"}], "//", "ToCanonical"}]}], "Input"],

Cell[BoxData[
 RowBox[{"Hold", "[", 
  InterpretationBox[
   StyleBox[
    RowBox[{
     SuperscriptBox["\[EmptyDownTriangle]", "c"], "[", 
     RowBox[{
      FractionBox["1", "4"], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {" ", " ", "e", "f"},
              {"d", "a", " ", " "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[-$CellContext`d, -$CellContext`a, \
$CellContext`e, $CellContext`f],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " ", " ", " "},
              {"e", "f", "g", "h"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RiemannCD[-$CellContext`e, -$CellContext`f, \
-$CellContext`g, -$CellContext`h],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {"g", "h", " ", " "},
              {" ", " ", "b", "c"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[$CellContext`g, $CellContext`h, \
-$CellContext`b, -$CellContext`c],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "d"], 
          InterpretationBox[
           StyleBox["F",
            ShowAutoStyles->False,
            AutoSpacing->False],
           $CellContext`F,
           Editable->False], "[", 
          InterpretationBox[
           StyleBox["\[CurlyTheta]",
            ShowAutoStyles->False,
            AutoSpacing->False],
           $CellContext`\[CurlyTheta][],
           Editable->False], "]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`d][
         $CellContext`F[
          $CellContext`\[CurlyTheta][]]],
        Editable->False], ")"}]}], "]"}],
    ShowAutoStyles->False,
    AutoSpacing->False],
   $CellContext`CD[$CellContext`c][((((1/
        4) $CellContext`epsilonmet[-$CellContext`d, -$CellContext`a, \
$CellContext`e, $CellContext`f]) $CellContext`RiemannCD[-$CellContext`e, \
-$CellContext`f, -$CellContext`g, -$CellContext`h]) \
$CellContext`epsilonmet[$CellContext`g, $CellContext`h, -$CellContext`b, \
-$CellContext`c]) $CellContext`CD[$CellContext`d][
      $CellContext`F[
       $CellContext`\[CurlyTheta][]]]],
   Editable->False], "]"}]], "Output"],

Cell[BoxData["True"], "Output"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"Hold", "[", 
  RowBox[{
   FractionBox["1", "4"], 
   RowBox[{"epsilonmet", "[", 
    RowBox[{
     RowBox[{"-", "d"}], ",", 
     RowBox[{"-", "a"}], ",", "e", ",", "f"}], "]"}], 
   RowBox[{"RiemannCD", "[", 
    RowBox[{
     RowBox[{"-", "e"}], ",", 
     RowBox[{"-", "f"}], ",", 
     RowBox[{"-", "g"}], ",", 
     RowBox[{"-", "h"}]}], "]"}], 
   RowBox[{"epsilonmet", "[", 
    RowBox[{"g", ",", "h", ",", 
     RowBox[{"-", "b"}], ",", 
     RowBox[{"-", "c"}]}], "]"}], 
   RowBox[{
    RowBox[{"CD", "[", "c", "]"}], "@", " ", 
    RowBox[{
     RowBox[{"CD", "[", "d", "]"}], "@", 
     RowBox[{"F", "[", 
      RowBox[{"\[CurlyTheta]", "[", "]"}], "]"}]}]}]}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"%", "//", "ReleaseHold"}], "//", "ContractMetric"}], "//", 
   "ToCanonical"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"%", "/.", "RuleDivRicci"}], "/.", "RuleDivRiemann"}], "//", 
   "ToCanonical"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"%", "==", "CEDGB"}], "//", "ToCanonical"}]}], "Input"],

Cell[BoxData[
 RowBox[{"Hold", "[", 
  RowBox[{
   FractionBox["1", "4"], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {"\[Epsilon]g", 
        StyleBox[GridBox[{
           {" ", " ", "e", "f"},
           {"d", "a", " ", " "}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`epsilonmet[-$CellContext`d, -$CellContext`a, $CellContext`e, \
$CellContext`f],
    Editable->False], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {
        RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
        StyleBox[GridBox[{
           {" ", " ", " ", " "},
           {"e", "f", "g", "h"}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`RiemannCD[-$CellContext`e, -$CellContext`f, -$CellContext`g, \
-$CellContext`h],
    Editable->False], " ", 
   InterpretationBox[
    StyleBox[GridBox[{
       {"\[Epsilon]g", 
        StyleBox[GridBox[{
           {"g", "h", " ", " "},
           {" ", " ", "b", "c"}
          },
          GridBoxSpacings->{"Columns" -> {
              Offset[0.], {
               Offset[0.034999999999999996`]}, 
              Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
               Offset[0.]}}, "RowsIndexed" -> {}}],
         FontSize->Rational[39, 4]]}
      },
      GridBoxAlignment->{
       "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Center}}, 
        "RowsIndexed" -> {}},
      GridBoxSpacings->{"Columns" -> {
          Offset[0.27999999999999997`], {
           Offset[0.034999999999999996`]}, 
          Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
          Offset[0.2], {
           Offset[0.4]}, 
          Offset[0.2]}, "RowsIndexed" -> {}}],
     ShowAutoStyles->False,
     AutoSpacing->False],
    $CellContext`epsilonmet[$CellContext`g, $CellContext`h, -$CellContext`b, \
-$CellContext`c],
    Editable->False], " ", 
   RowBox[{"(", 
    InterpretationBox[
     StyleBox[
      RowBox[{
       SuperscriptBox["\[EmptyDownTriangle]", "c"], 
       SuperscriptBox["\[EmptyDownTriangle]", "d"], 
       InterpretationBox[
        StyleBox["F",
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`F,
        Editable->False], "[", 
       InterpretationBox[
        StyleBox["\[CurlyTheta]",
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`\[CurlyTheta][],
        Editable->False], "]"}],
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`CD[$CellContext`c][
      $CellContext`CD[$CellContext`d][
       $CellContext`F[
        $CellContext`\[CurlyTheta][]]]],
     Editable->False], ")"}]}], "]"}]], "Output"],

Cell[BoxData["True"], "Output"]
}, Open  ]],

Cell[TextData[{
 "Thus we have that the EDGB metric equation of motion is\n  ",
 Cell[BoxData[
  FormBox[
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       SuperscriptBox[
        SubscriptBox["m", "pl"], "2"], 
       SubscriptBox["G", "ab"]}], "+", 
      RowBox[{"\[CurlyEpsilon]", 
       RowBox[{
        SuperscriptBox["\[Del]", "c"], 
        RowBox[{
         SuperscriptBox["\[Del]", "d"], 
         SuperscriptBox[
          RowBox[{"[", " "}], "*"]}]}], "\[NegativeThinSpace]", 
       SubscriptBox[
        SuperscriptBox["R", "*"], "dabc"], 
       RowBox[{"F", "[", "\[CurlyTheta]", "]"}]}]}], "]"}], "=", 
    SubscriptBox["T", "ab"]}], TraditionalForm]]]
}], "Text"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"EOMgGB", "==", 
     RowBox[{
      RowBox[{
       SuperscriptBox["mpl", "2"], 
       RowBox[{"EinsteinCD", "[", 
        RowBox[{
         RowBox[{"-", "a"}], ",", 
         RowBox[{"-", "b"}]}], "]"}]}], "-", "T\[CurlyTheta]", "+", 
      RowBox[{"\[CurlyEpsilon]", " ", 
       RowBox[{
        RowBox[{"CD", "[", "c", "]"}], "@", 
        RowBox[{
         RowBox[{"CD", "[", "d", "]"}], "[", 
         RowBox[{
          FractionBox["1", "4"], 
          RowBox[{"epsilonmet", "[", 
           RowBox[{
            RowBox[{"-", "d"}], ",", 
            RowBox[{"-", "a"}], ",", "e", ",", "f"}], "]"}], 
          RowBox[{"RiemannCD", "[", 
           RowBox[{
            RowBox[{"-", "e"}], ",", 
            RowBox[{"-", "f"}], ",", 
            RowBox[{"-", "g"}], ",", 
            RowBox[{"-", "h"}]}], "]"}], 
          RowBox[{"epsilonmet", "[", 
           RowBox[{"g", ",", "h", ",", 
            RowBox[{"-", "b"}], ",", 
            RowBox[{"-", "c"}]}], "]"}], 
          RowBox[{"F", "[", 
           RowBox[{"\[CurlyTheta]", "[", "]"}], "]"}]}], "]"}]}]}]}]}], "//", 
    "ContractMetric"}], "//", "ToCanonical"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{"%", "//", "EinsteinToRicci"}], ")"}], "/.", 
        RowBox[{"PreferDivOf", "[", "RicciCD", "]"}]}], "/.", 
       "RuleDivRicci"}], "/.", "RuleDivRiemann"}], "/.", "RiemSqRule"}], "/.", 
    RowBox[{"PreferDivOf", "[", "RicciCD", "]"}]}], "/.", "RuleDivRicci"}], "//",
   "ToCanonical"}]}], "Input"],

Cell[BoxData["True"], "Output"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["5. Dynamical Chern-Simons EOM and C-tensor", "Subsection"],

Cell["Get the g equation of motion:", "Text"],

Cell[BoxData[
 RowBox[{
  RowBox[{"EOMgCS", "=", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       FractionBox[
        RowBox[{"-", "2"}], 
        SqrtBox[
         RowBox[{"-", 
          RowBox[{"Detmet", "[", "]"}]}]]], 
       RowBox[{
        RowBox[{"VarD", "[", 
         RowBox[{
          RowBox[{"metpert", "[", 
           RowBox[{
            RowBox[{"LI", "[", "1", "]"}], ",", "a", ",", "b"}], "]"}], ",", 
          "CD"}], "]"}], "[", "LCSpert", "]"}]}], "/.", 
      RowBox[{
       RowBox[{"delta", "[", 
        RowBox[{
         RowBox[{"-", 
          RowBox[{"LI", "[", "1", "]"}]}], ",", 
         RowBox[{"LI", "[", "1", "]"}]}], "]"}], "\[Rule]", "1"}]}], "//", 
     "ContractMetric"}], "//", "ToCanonical"}]}], ";"}]], "Input"],

Cell[TextData[{
 "Extract the piece proportional to ",
 Cell[BoxData[
  FormBox["\[CurlyEpsilon]", TraditionalForm]]],
 ", which is the \[OpenCurlyDoubleQuote]C-tensor\[CloseCurlyDoubleQuote] for \
dCS, written in the usual messy way:"
}], "Text"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{
     RowBox[{"Coefficient", "[", 
      RowBox[{"EOMgCS", ",", "\[CurlyEpsilon]"}], "]"}], "/.", 
     "EpsBianchiRules"}], "/.", "RuleDivRiemann"}], "//", "ToCanonical"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"CDCS", "=", 
  RowBox[{"Collect", "[", 
   RowBox[{"%", ",", 
    RowBox[{"{", 
     RowBox[{
      RowBox[{
       RowBox[{"Derivative", "[", "_", "]"}], "[", "F", "]"}], "[", 
      RowBox[{"\[CurlyTheta]", "[", "]"}], "]"}], "}"}]}], "]"}]}]}], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{
   RowBox[{"(", 
    RowBox[{
     RowBox[{
      RowBox[{"-", 
       FractionBox["1", "4"]}], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {" ", " ", " ", " "},
              {"b", "d", "e", "f"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[-$CellContext`b, -$CellContext`d, \
-$CellContext`e, -$CellContext`f],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " ", "e", "f"},
              {"a", "c", " ", " "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RiemannCD[-$CellContext`a, -$CellContext`c, \
$CellContext`e, $CellContext`f],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "d"], 
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`d][
         $CellContext`CD[$CellContext`c][
          $CellContext`\[CurlyTheta][]]],
        Editable->False], ")"}]}], "-", 
     RowBox[{
      FractionBox["1", "4"], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {" ", " ", " ", " "},
              {"a", "d", "e", "f"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[-$CellContext`a, -$CellContext`d, \
-$CellContext`e, -$CellContext`f],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " ", "e", "f"},
              {"b", "c", " ", " "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RiemannCD[-$CellContext`b, -$CellContext`c, \
$CellContext`e, $CellContext`f],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "d"], 
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`d][
         $CellContext`CD[$CellContext`c][
          $CellContext`\[CurlyTheta][]]],
        Editable->False], ")"}]}], "-", 
     RowBox[{
      FractionBox["1", "2"], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {" ", " ", " ", " "},
              {"b", "c", "d", "e"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[-$CellContext`b, -$CellContext`c, \
-$CellContext`d, -$CellContext`e],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", "d", 
               RowBox[{";", "e"}]},
              {"a", " ", "  "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`CD[$CellContext`e][
        $CellContext`RicciCD[-$CellContext`a, $CellContext`d]],
       Editable->False]}], "-", 
     RowBox[{
      FractionBox["1", "2"], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {" ", " ", " ", " "},
              {"a", "c", "d", "e"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[-$CellContext`a, -$CellContext`c, \
-$CellContext`d, -$CellContext`e],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", "d", 
               RowBox[{";", "e"}]},
              {"b", " ", "  "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`CD[$CellContext`e][
        $CellContext`RicciCD[-$CellContext`b, $CellContext`d]],
       Editable->False]}]}], ")"}], " ", 
   RowBox[{
    SuperscriptBox[
     InterpretationBox[
      StyleBox["F",
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`F,
      Editable->False], "\[Prime]",
     MultilineFunction->None], "[", 
    InterpretationBox[
     StyleBox["\[CurlyTheta]",
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`\[CurlyTheta][],
     Editable->False], "]"}]}], "+", 
  RowBox[{
   RowBox[{"(", 
    RowBox[{
     RowBox[{
      RowBox[{"-", 
       FractionBox["1", "4"]}], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {" ", " ", " ", " "},
              {"b", "d", "e", "f"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[-$CellContext`b, -$CellContext`d, \
-$CellContext`e, -$CellContext`f],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " ", "e", "f"},
              {"a", "c", " ", " "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RiemannCD[-$CellContext`a, -$CellContext`c, \
$CellContext`e, $CellContext`f],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "d"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`d][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}]}], "-", 
     RowBox[{
      FractionBox["1", "4"], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {"\[Epsilon]g", 
           StyleBox[GridBox[{
              {" ", " ", " ", " "},
              {"a", "d", "e", "f"}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`epsilonmet[-$CellContext`a, -$CellContext`d, \
-$CellContext`e, -$CellContext`f],
       Editable->False], " ", 
      InterpretationBox[
       StyleBox[GridBox[{
          {
           RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
           StyleBox[GridBox[{
              {" ", " ", "e", "f"},
              {"b", "c", " ", " "}
             },
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.], {
                  Offset[0.034999999999999996`]}, 
                 Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                  Offset[0.]}}, "RowsIndexed" -> {}}],
            FontSize->Rational[39, 4]]}
         },
         GridBoxAlignment->{
          "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
           "Rows" -> {{Center}}, "RowsIndexed" -> {}},
         GridBoxSpacings->{"Columns" -> {
             Offset[0.27999999999999997`], {
              Offset[0.034999999999999996`]}, 
             Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
             Offset[0.2], {
              Offset[0.4]}, 
             Offset[0.2]}, "RowsIndexed" -> {}}],
        ShowAutoStyles->False,
        AutoSpacing->False],
       $CellContext`RiemannCD[-$CellContext`b, -$CellContext`c, \
$CellContext`e, $CellContext`f],
       Editable->False], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "c"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`c][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}], " ", 
      RowBox[{"(", 
       InterpretationBox[
        StyleBox[
         RowBox[{
          SuperscriptBox["\[EmptyDownTriangle]", "d"], "\[CurlyTheta]"}],
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`CD[$CellContext`d][
         $CellContext`\[CurlyTheta][]],
        Editable->False], ")"}]}]}], ")"}], " ", 
   RowBox[{
    SuperscriptBox[
     InterpretationBox[
      StyleBox["F",
       ShowAutoStyles->False,
       AutoSpacing->False],
      $CellContext`F,
      Editable->False], "\[Prime]\[Prime]",
     MultilineFunction->None], "[", 
    InterpretationBox[
     StyleBox["\[CurlyTheta]",
      ShowAutoStyles->False,
      AutoSpacing->False],
     $CellContext`\[CurlyTheta][],
     Editable->False], "]"}]}]}]], "Output"]
}, Open  ]],

Cell[TextData[{
 "Show that this can be written more simply as\n  ",
 Cell[BoxData[
  FormBox[
   RowBox[{
    RowBox[{
     SubscriptBox["C", "ab"], "\[DotEqual]", 
     RowBox[{
      RowBox[{
       SuperscriptBox["\[Del]", "c"], 
       RowBox[{
        SuperscriptBox["\[Del]", "d"], 
        SuperscriptBox[
         RowBox[{"[", " "}], "*"]}]}], "\[NegativeThinSpace]", 
      SubscriptBox["R", 
       RowBox[{
        RowBox[{"d", "(", "ab", ")"}], "c"}]], 
      RowBox[{"F", "[", "\[CurlyTheta]", "]"}]}]}], "]"}], TraditionalForm]]]
}], "Text"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"Hold", "[", 
  RowBox[{
   RowBox[{"CD", "[", "c", "]"}], "@", 
   RowBox[{
    RowBox[{"CD", "[", "d", "]"}], "[", 
    RowBox[{
     RowBox[{"Symmetrize", "[", 
      RowBox[{
       RowBox[{
        FractionBox["1", "2"], 
        RowBox[{"epsilonmet", "[", 
         RowBox[{
          RowBox[{"-", "d"}], ",", 
          RowBox[{"-", "a"}], ",", "e", ",", "f"}], "]"}], 
        RowBox[{"RiemannCD", "[", 
         RowBox[{
          RowBox[{"-", "e"}], ",", 
          RowBox[{"-", "f"}], ",", 
          RowBox[{"-", "b"}], ",", 
          RowBox[{"-", "c"}]}], "]"}]}], ",", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"-", "a"}], ",", 
         RowBox[{"-", "b"}]}], "}"}]}], "]"}], 
     RowBox[{"F", "[", 
      RowBox[{"\[CurlyTheta]", "[", "]"}], "]"}]}], "]"}]}], 
  "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{"%", "//", "ReleaseHold"}], "//", "Expand"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"%", "/.", "EpsBianchiRules"}], "/.", "RuleDivRiemann"}], "//", 
   "ToCanonical"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"%", "==", "CDCS"}], "//", "ToCanonical"}]}], "Input"],

Cell[BoxData[
 RowBox[{"Hold", "[", 
  InterpretationBox[
   StyleBox[
    RowBox[{
     SuperscriptBox["\[EmptyDownTriangle]", "c"], 
     SuperscriptBox["\[EmptyDownTriangle]", "d"], "[", 
     RowBox[{
      RowBox[{"Symmetrize", "[", 
       RowBox[{
        RowBox[{
         FractionBox["1", "2"], " ", 
         InterpretationBox[
          StyleBox[GridBox[{
             {"\[Epsilon]g", 
              StyleBox[GridBox[{
                 {" ", " ", "e", "f"},
                 {"d", "a", " ", " "}
                },
                GridBoxSpacings->{"Columns" -> {
                    Offset[0.], {
                    Offset[0.034999999999999996`]}, 
                    Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                    Offset[0.]}}, "RowsIndexed" -> {}}],
               FontSize->Rational[39, 4]]}
            },
            
            GridBoxAlignment->{
             "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
              "Rows" -> {{Center}}, "RowsIndexed" -> {}},
            GridBoxSpacings->{"Columns" -> {
                Offset[0.27999999999999997`], {
                 Offset[0.034999999999999996`]}, 
                Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
                Offset[0.2], {
                 Offset[0.4]}, 
                Offset[0.2]}, "RowsIndexed" -> {}}],
           ShowAutoStyles->False,
           AutoSpacing->False],
          $CellContext`epsilonmet[-$CellContext`d, -$CellContext`a, \
$CellContext`e, $CellContext`f],
          Editable->False], " ", 
         InterpretationBox[
          StyleBox[GridBox[{
             {
              RowBox[{"R", "[", "\[EmptyDownTriangle]", "]"}], 
              StyleBox[GridBox[{
                 {" ", " ", " ", " "},
                 {"e", "f", "b", "c"}
                },
                GridBoxSpacings->{"Columns" -> {
                    Offset[0.], {
                    Offset[0.034999999999999996`]}, 
                    Offset[0.]}, "ColumnsIndexed" -> {}, "Rows" -> {{
                    Offset[0.]}}, "RowsIndexed" -> {}}],
               FontSize->Rational[39, 4]]}
            },
            
            GridBoxAlignment->{
             "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, 
              "Rows" -> {{Center}}, "RowsIndexed" -> {}},
            GridBoxSpacings->{"Columns" -> {
                Offset[0.27999999999999997`], {
                 Offset[0.034999999999999996`]}, 
                Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> {
                Offset[0.2], {
                 Offset[0.4]}, 
                Offset[0.2]}, "RowsIndexed" -> {}}],
           ShowAutoStyles->False,
           AutoSpacing->False],
          $CellContext`RiemannCD[-$CellContext`e, -$CellContext`f, \
-$CellContext`b, -$CellContext`c],
          Editable->False]}], ",", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"-", "a"}], ",", 
          RowBox[{"-", "b"}]}], "}"}]}], "]"}], " ", 
      RowBox[{
       InterpretationBox[
        StyleBox["F",
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`F,
        Editable->False], "[", 
       InterpretationBox[
        StyleBox["\[CurlyTheta]",
         ShowAutoStyles->False,
         AutoSpacing->False],
        $CellContext`\[CurlyTheta][],
        Editable->False], "]"}]}], "]"}],
    ShowAutoStyles->False,
    AutoSpacing->False],
   $CellContext`CD[$CellContext`c][
    $CellContext`CD[$CellContext`d][
    xAct`xTensor`Symmetrize[((1/
         2) $CellContext`epsilonmet[-$CellContext`d, -$CellContext`a, \
$CellContext`e, $CellContext`f]) $CellContext`RiemannCD[-$CellContext`e, \
-$CellContext`f, -$CellContext`b, -$CellContext`c], {-$CellContext`a, \
-$CellContext`b}] $CellContext`F[
       $CellContext`\[CurlyTheta][]]]],
   Editable->False], "]"}]], "Output"],

Cell[BoxData["True"], "Output"]
}, Open  ]],

Cell[TextData[{
 "Thus we have that the DCS metric equation of motion is\n  ",
 Cell[BoxData[
  FormBox[
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{
       SuperscriptBox[
        SubscriptBox["m", "pl"], "2"], 
       SubscriptBox["G", "ab"]}], "+", 
      RowBox[{"\[CurlyEpsilon]", 
       RowBox[{
        SuperscriptBox["\[Del]", "c"], 
        RowBox[{
         SuperscriptBox["\[Del]", "d"], 
         SuperscriptBox[
          RowBox[{"[", " "}], "*"]}]}], "\[NegativeThinSpace]", 
       SubscriptBox["R", 
        RowBox[{
         RowBox[{"d", "(", "ab", ")"}], "c"}]], 
       RowBox[{"F", "[", "\[CurlyTheta]", "]"}]}]}], "]"}], "=", 
    SubscriptBox["T", "ab"]}], TraditionalForm]]]
}], "Text"],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"EOMgCS", "==", 
    RowBox[{
     RowBox[{
      SuperscriptBox["mpl", "2"], 
      RowBox[{"EinsteinCD", "[", 
       RowBox[{
        RowBox[{"-", "a"}], ",", 
        RowBox[{"-", "b"}]}], "]"}]}], "-", "T\[CurlyTheta]", "+", 
     RowBox[{"\[CurlyEpsilon]", " ", 
      RowBox[{
       RowBox[{"CD", "[", "c", "]"}], "@", 
       RowBox[{
        RowBox[{"CD", "[", "d", "]"}], "[", 
        RowBox[{
         RowBox[{"Symmetrize", "[", 
          RowBox[{
           RowBox[{
            FractionBox["1", "2"], 
            RowBox[{"epsilonmet", "[", 
             RowBox[{
              RowBox[{"-", "d"}], ",", 
              RowBox[{"-", "a"}], ",", "e", ",", "f"}], "]"}], 
            RowBox[{"RiemannCD", "[", 
             RowBox[{
              RowBox[{"-", "e"}], ",", 
              RowBox[{"-", "f"}], ",", 
              RowBox[{"-", "b"}], ",", 
              RowBox[{"-", "c"}]}], "]"}]}], ",", 
           RowBox[{"{", 
            RowBox[{
             RowBox[{"-", "a"}], ",", 
             RowBox[{"-", "b"}]}], "}"}]}], "]"}], 
         RowBox[{"F", "[", 
          RowBox[{"\[CurlyTheta]", "[", "]"}], "]"}]}], "]"}]}]}]}]}], "//", 
   "Expand"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
   RowBox[{
    RowBox[{"%", "/.", "EpsBianchiRules"}], "/.", "RuleDivRiemann"}], "//", 
   "EinsteinToRicci"}], "//", "ToCanonical"}]}], "Input"],

Cell[BoxData["True"], "Output"]
}, Open  ]]
}, Open  ]]
}, Open  ]]
},
WindowSize->{1280, 774},
WindowMargins->{{Automatic, 105}, {Automatic, 0}},
PrivateNotebookOptions->{"FileOutlineCache"->False},
TrackCellChangeTimes->False,
FrontEndVersion->"10.4 for Mac OS X x86 (32-bit, 64-bit Kernel) (April 11, \
2016)",
StyleDefinitions->"Default.nb",
ShowAutoSpellCheck -> False
]

